PCT
image/x-pict
Magic Bytes
Offset: 522
00 11 02 FF 0C 00
The PCT file format, also known as PICT, is a legacy graphics standard developed by Apple for the classic Macintosh operating system. It served as the primary metafile format for storing vector and bitmap image data within the native QuickDraw imaging framework of the original Mac environment. Although now obsolete and superseded by modern standards like PDF, the format is considered safe for archival purposes, though specialized libraries are often required for contemporary cross-platform rendering.
Validation Code
How to validate .pct files in Python
Python
def is_pct(file_path: str) -> bool:
"""
Check if file is a valid PCT by magic bytes.
Signature offset: 522 bytes
"""
signature = bytes([0x00, 0x11, 0x02, 0xFF, 0x0C, 0x00])
with open(file_path, "rb") as f:
f.seek(522)
return f.read(6) == signature
How to validate .pct files in Node.js
Node.js
function isPCT(buffer: Buffer): boolean {
// Signature offset: 522 bytes
const signature = Buffer.from([0x00, 0x11, 0x02, 0xFF, 0x0C, 0x00]);
if (buffer.length < 528) return false;
return buffer.subarray(522, 528).equals(signature);
}
Go
func IsPCT(data []byte) bool {
// Signature offset: 522 bytes
signature := []byte{0x00, 0x11, 0x02, 0xFF, 0x0C, 0x00}
if len(data) < 528 {
return false
}
return bytes.Equal(data[522:528], signature)
}
API Endpoint
GET
/api/v1/pct
curl https://filesignature.org/api/v1/pct