Description
XCF is GIMP's native project file format that preserves layers, masks, paths, and history for non-destructive editing.
When to Use
What is XCF and what does it store in GIMP? | Explain XCF layer structure and history preservation. | How does XCF compare to PSD for GIMP workflows? | List XCF file extensions and compression options. | What features are preserved in XCF files?
Use Cases
Explain GIMP's XCF layer structure for editing sessions. | Identify XCF features preserved during export. | Compare XCF with PSD for open-source workflows. | Explain how XCF stores history and parasites.
SKILL.md Content
---
name: xcf
description: "XCF is GIMP's native project file format that preserves layers, masks, paths, and history for non-destructive editing."
metadata:
tags: "file-formats, graphics, xcf, gimp, layer-management, non-destructive-editing, open-source, image-editing"
source: "https://skilldb.dev/skills/file-formats-skills/xcf"
pack: "file-formats-skills"
category: "Technology & Engineering"
---
# XCF (.xcf)
## When to use this skill
Use when the user says things like:
- "What is XCF and what does it store in GIMP?"
- "Explain XCF layer structure and history preservation."
- "How does XCF compare to PSD for GIMP workflows?"
- "List XCF file extensions and compression options."
- "What features are preserved in XCF files?"
You are a file format specialist with deep knowledge of the XCF file format, its layer architecture, GIMP feature preservation, and role in open-source image editing workflows.
## Overview
XCF (eXperimental Computing Facility) is the native file format for GIMP (GNU Image Manipulation Program), the leading open-source raster image editor. The name derives from the eXperimental Computing Facility at the University of California, Berkeley, where GIMP was originally developed by Spencer Kimball and Peter Mattis in 1995-1996. XCF stores the complete editing state of a GIMP project, including all layers, channels, paths, parasites (attached metadata), and editing history. The format has evolved with GIMP versions but maintains backward compatibility. XCF serves the same purpose for GIMP users that PSD serves for Photoshop users: preserving full project state for non-destructive editing.
## Technical Specifications
- **File extension(s):** `.xcf`, `.xcf.gz` (gzip compressed), `.xcf.bz2` (bzip2 compressed), `.xcf.xz` (xz compressed)
- **MIME type:** `image/x-xcf`
- **Compression type:** Individual tile data uses RLE compression within the format. The entire file can optionally be wrapped in gzip, bzip2, or xz compression (GIMP handles this transparently based on the file extension).
- **Color depth:** 8-bit, 16-bit, and 32-bit per channel (integer and floating-point). High bit depth support was added in GIMP 2.10.
- **Max dimensions:** Limited by available memory (GIMP uses 32-bit signed integers for dimensions internally)
- **Color modes:** RGB, Grayscale, Indexed (up to 256 colors). No native CMYK support (a significant limitation compared to PSD).
- **Layer types:** Normal (pixel) layers, layer groups (folders), text layers, floating selections
- **Features preserved:** Layer blend modes (44+ modes in GIMP 2.10+), opacity, layer masks, channel masks, paths (vector curves), parasites (arbitrary attached data), guides, grid settings, active layer/channel/path state, undo history (optionally)
- **Tile-based storage:** Image data is stored in tiles (typically 64x64 pixels), enabling efficient partial loading and editing of large images
- **Metadata support:** Parasites system stores arbitrary key-value data including EXIF, XMP, ICC color profiles, and GIMP-specific settings
## How to Work With It
### Opening & Viewing
- **GIMP:** Full support (the defining application). All versions can open XCF files from older versions.
- **XnView MP:** Can display XCF files (flattened view, limited layer support)
- **Krita:** Can open XCF files with basic layer support
- **GNOME Image Viewer (Eye of GNOME):** Thumbnail and basic display
- **Programming:** Python `xcftools` or `gimpformats` library for parsing XCF without GIMP
- **Command line:** `xcf2png input.xcf -o output.png` (from xcftools package)
- **Note:** Most applications outside GIMP cannot fully interpret XCF; they show a flattened composite at best
### Creating & Editing
- **GIMP workflow:** File > Export As for final output (JPEG, PNG, etc.); File > Save/Save As saves XCF (GIMP's "Save" only saves XCF, by design)
- **Compression:** Save as `.xcf.gz` or `.xcf.bz2` for significantly smaller files (GIMP detects compression from extension)
- **Layer management:** Name layers descriptively. Use layer groups for organization. Use layer masks for non-destructive editing.
- **Text layers:** Text remains editable in XCF (unlike flattened exports). Font must be available on the system when reopening.
- **GIMP Script-Fu/Python-Fu:** Automate XCF creation and manipulation programmatically within GIMP
### Converting To/From
- **XCF to PNG:** In GIMP: File > Export As > PNG. Command line: `xcf2png input.xcf -o output.png` or `gimp -i -b '(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE "in.xcf" "in.xcf")))) (file-png-save RUN-NONINTERACTIVE image (car (gimp-image-flatten image)) "out.png" "out.png" 0 9 1 1 1 1 1) (gimp-quit 0))'`
- **XCF to JPEG:** GIMP File > Export As > JPEG
- **PSD to XCF:** Open PSD in GIMP (layers imported), then Save As .xcf
- **XCF to PSD:** GIMP File > Export As > .psd (some features may not translate perfectly)
- **Batch export:** GIMP's Script-Fu or Python-Fu can batch process XCF files
- **Flatpak GIMP:** `flatpak run org.gimp.GIMP -i -b '(...script...)'` for containerized batch processing
## Common Use Cases
- GIMP project files (primary use case; preserving editing state)
- Open-source graphic design workflows
- Linux desktop image editing
- Photo retouching and compositing in GIMP
- Digital art and illustration (with GIMP or Krita)
- Educational projects using free software
- Collaborative workflows where all participants use GIMP
- Archival of layered editing work in open-source environments
## Pros & Cons
**Pros:**
- Preserves complete GIMP editing state (layers, masks, paths, text, blend modes)
- Open format with publicly available specification
- No vendor lock-in (GIMP is free and open source)
- Supports high bit depth (16-bit, 32-bit float) since GIMP 2.10
- Built-in compression options (.xcf.gz, .xcf.bz2, .xcf.xz)
- Tile-based storage efficient for large images
- Backward compatible (newer GIMP opens older XCF files)
- Text layers remain editable
- No file size limits beyond available storage
**Cons:**
- Virtually no support outside of GIMP (much more limited ecosystem than PSD)
- No CMYK color mode (limits professional print use)
- Cannot be previewed in web browsers or most file managers
- Large file sizes without external compression
- Not suitable for interchange with Photoshop users (use PSD export instead)
- Limited third-party library support for parsing
- No standard quick-preview mechanism (unlike PSD's flattened composite)
- Format documentation is primarily in GIMP source code rather than a formal specification
## Compatibility
| Platform | Support |
|----------|---------|
| GIMP | Full (all versions, defining application) |
| Krita | Basic import (layers, limited features) |
| XnView MP | Flattened display |
| Photoshop | Not supported (export to PSD from GIMP for interchange) |
| Web browsers | Not supported |
| GNOME desktop | Thumbnail preview |
| xcftools | Command-line extraction (xcf2png, xcf2pnm, xcfinfo) |
| Python gimpformats | Programmatic parsing |
## Practical Usage
### Batch export XCF files to PNG from the command line
```bash
# Export all XCF files in a directory to flattened PNG using GIMP's batch mode
for f in *.xcf; do
gimp -i -b "(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE \"$f\"" \""$f\"")))