Skip to content

GNU Image Manipulation Program (.xcf)

.xcf file signature | image/x-xcf

GNU Image Manipulation Program (GIMP) eXperimental Computing Facility (XCF)image file

Safe

Magic Bytes

Offset 0
67 69 6D 70 20 78 63 66 20

Sources: Apache Tika, Gary Kessler

All Known Signatures

2 signature variants are documented for .xcf files across multiple sources.

Hex Signature Offset Sources
67 69 6D 70 20 78 63 66 20 0 Apache Tika, Gary Kessler
67 69 6D 70 20 78 63 66 0 Wikipedia

Extension

.xcf

MIME Type

image/x-xcf

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .xcf files in Python

Python
def is_xcf(file_path: str) -> bool:
    """Check if file is a valid XCF by magic bytes."""
    signature = bytes([0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20])
    with open(file_path, "rb") as f:
        return f.read(9) == signature

How to validate .xcf files in Node.js

Node.js
function isXCF(buffer: Buffer): boolean {
  const signature = Buffer.from([0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20]);
  return buffer.subarray(0, 9).equals(signature);
}

How to validate .xcf files in Go

Go
func IsXCF(data []byte) bool {
    signature := []byte{0x67, 0x69, 0x6D, 0x70, 0x20, 0x78, 0x63, 0x66, 0x20}
    if len(data) < 9 {
        return false
    }
    return bytes.Equal(data[:9], signature)
}

API Endpoint

GET /api/v1/xcf
curl https://filesignature.org/api/v1/xcf

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .xcf file?

A .xcf file is a GNU Image Manipulation Program file. GNU Image Manipulation Program (GIMP) eXperimental Computing Facility (XCF)image file

What are the magic bytes for .xcf files?

The magic bytes for GNU Image Manipulation Program files are 67 69 6D 70 20 78 63 66 20 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .xcf file?

To validate a .xcf file, read the first bytes of the file and compare them against the known magic bytes (67 69 6D 70 20 78 63 66 20) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .xcf files?

The primary MIME type for .xcf files is image/x-xcf.

Is it safe to open .xcf files?

GNU Image Manipulation Program (.xcf) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.