What Is a .XCF File?
GIMP image
GIMP Image (.xcf)
Overview
XCF (eXperimental Computing Facility, named after the Berkeley lab where GIMP began) is the native project format of GIMP, the free image editor. An .xcf file keeps everything an editing session needs: every layer with its own blend mode and opacity, layer groups, masks, channels, paths, selections, guides, text layers that remain editable, and the full undo-relevant state.
It is to GIMP what .psd is to Photoshop: the working file you save while editing, not the image you send to anyone. Exporting to PNG or JPEG flattens all of that into pixels.
Technical Specifications
- MIME Type:
image/x-xcf - File Extensions:
.xcf;.xcf.gz,.xcf.bz2and.xcf.xzfor compressed variants GIMP reads directly - Category: Image
- Developer: the GIMP project
- Introduced: 1996, with GIMP 0.54
- Current version: XCF v011 and later (GIMP 2.10), v012+ (GIMP 3.0)
- Magic bytes:
67 69 6D 70 20 78 63 66 20(gimp xcf) followed by the version
Identification
00000000 67 69 6d 70 20 78 63 66 20 76 30 31 31 00 00 00 |gimp xcf v011...|
00000010 07 80 00 00 04 38 00 00 00 00 00 00 00 ... |.....8..........|
The 9-byte gimp xcf signature is followed by a 4-byte version string (file for the original format, v001 to v012 and beyond) and a null byte. Then come the canvas width, height and base colour type. Compressed variants start with the gzip, bzip2 or xz magic instead and must be decompressed to reveal this.
File Structure
XCF file
├── Header signature, version, width, height, base type, precision (v004+)
├── Image properties compression, resolution, colour map, guides, parasites (metadata blobs)
├── Layer pointers offsets to each layer
├── Channel pointers offsets to each channel (alpha, masks, selection)
└── Hierarchies per layer: tiles of 64 x 64 pixels, RLE- or zlib-compressed
Pixel data is stored in 64 x 64 tiles, which is how GIMP edits very large images without loading everything. Layers can be larger than the canvas and offset anywhere. Parasites are named binary blobs that hold things like Exif data, text-layer markup and plugin settings.
GIMP 2.10 added high bit depth (16 and 32-bit integer and float per channel) and linear-light precision, which older GIMP versions cannot read. Files saved by 2.10 or 3.0 need a matching or newer GIMP.
History and Development
XCF appeared with the first public GIMP in 1996 and has been extended rather than replaced ever since. It was never designed as an interchange format, and the GIMP developers have said so: it is a serialisation of GIMP's internal image model, which is why other applications support it only partially.
A formal specification was written and is maintained in the GIMP source tree, which allowed ImageMagick, Krita, Darktable and a few others to read at least the composited image.
Common Use Cases
- Work in progress in GIMP: anything with layers, masks or editable text
- Source files for icons, mockups, textures and photo retouching done in GIMP
- Archival of the editable version alongside an exported PNG or JPEG
- Collaboration between GIMP users, since the file carries the full edit state
How to Open an XCF File
GIMP (all platforms)
GIMP is free and the only application that opens XCF with full fidelity. Download it for Windows, macOS or Linux from gimp.org; it is in every Linux repository and in Homebrew (brew install --cask gimp). File, Open, or drag the file onto the window.
A file that opens with a warning about an unsupported version was saved by a newer GIMP; update GIMP.
Without GIMP
- Krita imports XCF with layers (reasonably well for ordinary layer stacks).
- Darktable and RawTherapee open XCF as a flattened image for editing.
- ImageMagick:
magick file.xcf -flatten file.pngextracts the composite. - XnView MP and IrfanView (with plugins) display the flattened image.
- Photoshop does not open XCF. Export from GIMP to PSD first.
- Online: Photopea opens XCF with layers in a browser.
Inspecting without opening
file image.xcf
# image.xcf: GIMP XCF image data, version 011, 1920 x 1080, RGB Color
magick identify image.xcf
How to Convert an XCF File
Export a finished image from GIMP
File, Export As (Ctrl+Shift+E), choose PNG, JPEG, WebP, TIFF or any other format. Export flattens the visible layers into one image and leaves the XCF untouched. Save and Save As only ever write XCF; this split confuses newcomers but protects the editable version.
Convert to PSD for Photoshop
File, Export As, choose .psd. Layers, masks, opacity and most blend modes survive; GIMP-specific features (layer groups in older versions, some modes) may flatten or change.
Command line
# Flattened composite to PNG
magick file.xcf -flatten file.png
# Each layer as a separate PNG
magick file.xcf layer_%02d.png
# Batch export with GIMP itself, headless
gimp -i -b '(let* ((img (car (gimp-file-load RUN-NONINTERACTIVE "in.xcf" "in.xcf"))) (lay (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))) (gimp-file-save RUN-NONINTERACTIVE img lay "out.png" "out.png"))' -b '(gimp-quit 0)'
For large batches, a Python-Fu or GIMP 3 Python script is easier to maintain than Script-Fu one-liners.
Compressing
GIMP saves .xcf.gz or .xcf.xz if you name the file that way, and reads them back transparently. Since GIMP 2.10 the format uses zlib tile compression by default, so the external gzip adds little; xz still helps for archives.
Advantages
- Complete fidelity for GIMP projects: nothing is lost between sessions.
- Open format with a published specification and a free editor.
- High bit depth and linear light since 2.10.
- Tiled storage keeps huge images workable.
Limitations
- Effectively GIMP-only for anything beyond the flattened image.
- Large files: layers are stored in full, and compression is modest.
- Version coupling: newer GIMP files do not open in older GIMP.
- Not for delivery: browsers, phones and most software cannot display it.
Related Formats
How to identify .XCF files from the bytes
GIMP image files carry a fixed byte pattern, the file signature or magic number, that identifies them regardless of the extension. This is what our detector reads.
| Offset | Hex | ASCII |
|---|---|---|
| 0 | 67 69 6D 70 20 78 63 66 20Followed by the version string, e.g. v011. | gimp xcf |
Check a file yourself: xxd -l 16 file.xcf on macOS and Linux, or Format-Hex file.xcf | Select-Object -First 1 in PowerShell.Full XCF signature reference
File Information
GIMP image
Image
.xcf
image/x-xcf
Related File Types
Other file types in the Image category you might also need:
Start Analyzing XCF Files Now
Use our free AI-powered tool to detect and analyze GIMP image files instantly with Google's Magika technology.
⚡Try File Detection Tool