Hubbry Logo
XCF (file format)XCF (file format)Main
Open search
XCF (file format)
Community hub
XCF (file format)
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
XCF (file format)
XCF (file format)
from Wikipedia
XCF
Filename extension
.xcf
Internet media type
image/x-xcf
Magic numbergimp xcf 
Developed byGIMP
Initial release15 December 1997; 28 years ago (1997-12-15)
Container forGraphics
Open format?yes, but standard is ad hoc

XCF, short for eXperimental Computing Facility,[1] is the native image format of the GIMP image-editing program. It saves all of the data the program handles related to the image, including, among others, each layer, the current selection, channels, transparency, paths and guides.

Prior to version 4 (GIMP 2.10.0, released on 2018-04-27), the saved image data are compressed only by a simple RLE algorithm, but GIMP supports compressed files, using gzip, bzip2, or xz. The compressed files can be opened as normal image files. Since version 4, the image data can be compressed by zlib instead.

The XCF file format is backward compatible (all versions of GIMP can open earlier versions' files) and in some cases, forward compatible. For example, GIMP 2.0 can save text in text layers while GIMP 1.2 cannot. Text layers saved in GIMP 2.0 will open as ordinary image layers in GIMP 1.2. However, XCF files containing layer groups, a feature introduced in GIMP 2.7, cannot be opened with GIMP 2.6.

Despite some use in other programs[2][3][4][5][6] (see §software support), the use of XCF as a data interchange format is not recommended by the developers of GIMP, [7] since the format reflects GIMP's internal data structures and there may be minor format changes in future versions. Instead, a collaborative effort between the developers of GIMP and Krita is underway to design a standardised raster file format called OpenRaster (modelled on the OpenDocument format) for future use in both applications, and likely in others also.

GIMP's Save dialog saves in the XCF format: starting with version 2.8, other formats with import/export support were moved to an Export dialog.

Software support

[edit]

A partial list of image viewers and conversion software.

Selected software with some support for XCF
application XCF-capable? notes
GIMP default format program for which the format was developed
Seashore default format[2] lightweight native Mac OS X image editing program based on GIMP
CinePaint default format, but nonstandard fork of GIMP with support for 16-bit and 32-bit floating point channels, and 16-bit integer channels; the XCF file format used in CinePaint has diverged from the GIMP's native format, so XCF files created in GIMP cannot be opened in CinePaint, and vice versa
DBGallery does not support colour indexing displays multi-layer non-indexed images and allows indexing, searching and other photo database operation
ImageMagick does not support colour indexing or multiple layers has an XCF reader module that can read single-layer non-indexed images
Project Dogwaffle see ImageMagick row (including PD Pro, PD Particles and PD Artist) imports XCF files using the ImageMagick library
Krita Yes imports XCF files using the GraphicsMagick library
Kolourpaint Yes can read XCF files using KDE's image I/O library plugin, like any other KDE program
Gwenview does not support colour indexing can display multi-layer non-indexed images
Digikam does not support colour indexing can display multi-layer non-indexed images
Imagine does not support colour indexing or multiple layers can display single-layer non-indexed images
XnView does not support colour indexing or multiple layers can display single-layer non-indexed images
Inkscape export only[3] added support for XCF export in the 0.44 release
IrfanView requires plugin[4] can display multi-layer images (composite image and individual layers) with a plugin
Paint.NET requires plugin can load and save multi-layer .xcf/.xcfgz/.xcfbz2 images (via ImXCF.FileType plugin)
PhotoLine import only loads multi-layer images with layer masks and blend modes
Chasys Draw IES Yes can load and save multi-layer .xcf/.xcfgz/.xcfbz2 images (from version 3.71.02)
MediaWiki and thus Wikimedia Commons does not support colour indexing or later versions[5] supports XCF files that are compatible with GIMP 2.6 or 2.8, and when the color mode is RGB or grayscale
Corel Photo-Paint does not support layer mask or paths can load multi-layer images, support some layer modes
Photopea Yes online image editor which can open XCF files and convert to other formats including Photoshop's PSD
SDL2_image Yes[6] development library

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The XCF (eXperimental Computing Facility) file format is the native image format of the GNU Image Manipulation Program (GIMP), an open-source . It is specifically designed to store the complete state of a GIMP image project, including layers, channels, layer masks, paths, selections, guides, and associated properties such as color models (RGB, , or indexed), alpha channels, and precision levels up to 64 bits per channel (integer or floating-point). Introduced with GIMP version 0.99.16 on December 15, 1997, the XCF format has evolved alongside GIMP's development, with file versions ranging from 0 to 23 as of GIMP 3.0 (March 2025), and up to 25 in GIMP 3.2.0 (November 2025). Early versions supported basic image data and color maps, while later iterations added features like layer modes (version 2, 2002), layer groups (version 3, 2010), and high-bit-depth support (versions 4–13, GIMP 2.10 in 2018). Unlike interchange formats such as or , XCF prioritizes editability over portability, using a tiled structure (64×64 pixel blocks) for efficient storage and compression methods including (RLE), zlib, or uncompressed data. This makes it ideal for work-in-progress files within , though it can be exported to other formats for sharing; compressed variants often use extensions like .xcf.gz or .xcf.bz2. The format's specification is documented in GIMP's and developer resources, ensuring compatibility across GIMP versions while allowing for backward compatibility.

Overview

Introduction

The XCF file format, an acronym for eXperimental Computing Facility, serves as the native image format for (GNU Image Manipulation Program), the open-source raster graphics editor originally developed at the . Designed to capture the full editable state of a GIMP image, XCF enables users to save and restore complex projects by preserving elements such as layers, channels, paths, selections, and associated metadata, excluding transient data like undo history or tool settings. This layered raster format inherently supports transparency via alpha channels and facilitates non-destructive by isolating modifications to individual layers and (with support for non-destructive filters since 3.0), while accommodating images across a range of resolutions defined by the canvas dimensions and pixel depth. XCF files are identified by the primary .xcf extension, with offering optional compression variants like .xcf.gz () and .xcf.bz2 () to optimize storage without altering the data integrity.

Key Features

The XCF file format supports multiple layers, each with customizable properties such as opacity on a 0-255 scale (or floating-point precision in later implementations), various including Normal, Multiply, and Soft Light, and layer masks for non-destructive editing. This layered structure allows users to compose complex images while preserving editability, distinguishing XCF from raster formats that flatten content upon saving. Channels in XCF extend beyond standard color data to include alpha channels for transparency, selection channels for precise masking, and auxiliary channels for storing additional information like custom masks or paintable selections. Multiple active channels can be managed simultaneously, enabling workflows that involve layered selections without data loss. The format incorporates paths for storing vector-based elements, such as Bézier curves and anchors, and guides for aligning objects during editing. These features facilitate the integration of within raster projects, supporting precise design and layout tasks. Parasites provide a mechanism for embedding arbitrary metadata, including EXIF-like tags for image properties or data from plugins, ensuring extensibility without altering the core structure. is achieved through elements like layer groups, which nest layers for better management in complex documents (introduced in later versions), and support for multiple selections across layers or channels. XCF accommodates varying precision levels per channel, including 8-bit for standard images, 16-bit for enhanced detail, and floating-point (32-bit or 64-bit, in linear or gamma-corrected modes) to handle (HDR) content. The format also supports non-destructive filters applied to layers since GIMP 3.0 (March 2025). Compression options, such as RLE or zlib, are available to optimize file size while maintaining these features.

History and Development

Origins and Evolution

The XCF file format was developed in 1997 as the native format for the , emerging alongside the software's early versions to address the limitations of ad-hoc saving methods used in prior releases. Introduced with GIMP version 0.99.16 on December 15, 1997, as part of the 0.99 pre-release series, XCF was designed to store comprehensive image data, including layers, channels, and editable elements, ensuring full preservation of the project's state—unlike export formats such as or , which prioritize compression over editability. This motivation stemmed from 's origins as a free alternative to proprietary image editors, where maintaining workflow continuity was essential for users and developers alike. Over time, the XCF format has evolved in close tandem with 's feature enhancements, with updates incorporated to support advanced capabilities such as expanded layer functionalities and higher bit depths, allowing the format to remain viable as incorporated new tools and user demands. These changes reflect a commitment to adaptability, ensuring XCF could handle increasingly complex image manipulations without losing for core elements. Maintenance of XCF is managed directly by the development team through the source code located in the app/xcf directory of the project's repository, with formal documentation periodically revised—the current version covering developments up to GIMP 3.2.0 as of 2025. Notably, XCF differs from variants like the one extended by , which introduced proprietary modifications rendering it incompatible with standard GIMP implementations.

Version History

The XCF file format was first introduced with GIMP version 0.99.16 on December 15, 1997, under version 0, supporting basic image data structures including pixels, layers, and channels. Version 1, released concurrently, extended this by adding support for color maps via the PROP_COLOR_MAP property. Version 2 arrived with GIMP 1.3.10 on November 7, 2002, introducing new layer such as soft light, grain extract, and grain merge, along with the painting mode color erase; path handling was further improved in a 2003 update. Version 3, released with GIMP 2.7.1 on June 29, 2010, added support for layer groups through properties like PROP_GROUP_ITEM, PROP_GROUP_ITEM_FLAGS, and PROP_ITEM_PATH. From version 4 to 13, introduced with GIMP 2.10.0 on April 27, 2018, the format incorporated additional layer modes and group masks, high-bit-depth pixel support, zlib compression for data tiles, and 64-bit file offsets to accommodate larger files exceeding 2 GB. Subsequent versions 14 through 25, starting with 3.0.0 on March 16, 2025, and extending into development versions toward GIMP 3.2.0 (expected late 2025), brought enhancements for modern workflows, including multiple layer selections via repeated PROP_ACTIVE_LAYER entries, new layer and channel properties such as PROP_LOCK_VISIBILITY (with position and alpha locks applicable to groups), layer effects structures, and vector layers via PROP_VECTOR_LAYER and related resource types. Other refinements in this range addressed guides extending off-canvas, multi-channel selections, updated font formats for text layers, perceptual RGB compositing spaces, and effect versioning. The format maintains strong , allowing newer versions to open and render older XCF files, though advanced features from later versions may degrade or be ignored in earlier software releases.

Technical Specifications

File Header

The XCF file format begins with a fixed header that identifies the file and provides essential metadata about the . This header starts with a 9-byte magic number consisting of the ASCII string "gimp xcf ", immediately followed by a 4-byte version identifier, such as "v001" for early versions or "v025" for more recent ones, and terminated by a null byte. The version field determines the overall structure and supported features of the file, with higher versions enabling advanced capabilities like and larger file sizes. Following the version, the header includes two 32-bit unsigned s representing the image width and height in pixels, defining the dimensions. A 32-bit unsigned specifies the image type: 0 for RGB color, 1 for , or 2 for mode. Since version 4, an additional 32-bit unsigned field denotes the precision, indicating bits per channel and the encoding type (e.g., 100 for 8-bit linear or 750 for 64-bit gamma floating point); in earlier versions (0–3), this field is absent, defaulting to 8-bit gamma precision. The header also contains metadata on compression and structural elements. A property (PROP_COMPRESSION) specifies the compression type for : 0 for no compression, 1 for (RLE, available since ), or 2 for zlib compression (introduced in version 4). The number of layers is indicated by an array of 32-bit (or 64-bit in later versions) pointers to layer offsets, terminated by a zero pointer, followed similarly by an array for the number of channels. To support files exceeding 4 GB, version 4 and later use 64-bit offsets throughout the file structure, replacing 32-bit pointers to accommodate large images without overflow issues.

Layer and Image Data Structure

The XCF file format organizes image content into a hierarchical structure that supports multiple layers, channels, and associated metadata, enabling complex compositions in software like . After the file header, the core image data begins with a of drawables, which encompass layers, layer masks, and channels, each contributing to the overall pixel composition. This structure allows for non-destructive editing by isolating elements and their properties independently. Pixel data within the XCF format is stored using a tile-based system, where the canvas is divided into non-overlapping of up to 64 pixels by 64 pixels, arranged in row-major order for efficient access and partial loading of large images. The rightmost and bottommost tiles may be smaller if the image dimensions are not multiples of 64, and the reader computes these dimensions dynamically. Each drawable's pixel data follows as a contiguous block of compressed tiles, facilitating memory-efficient handling without loading the entire at once. Compression is applied to these tile data blocks, though the specific encoding varies by version. Layers form the primary building blocks of the image , with each layer defined by a series of properties followed by its data. Key properties include a encoded name stored as a variable-length string for identification; width and height as 32-bit unsigned matching or subsetting the size; x and y offsets as 32-bit signed to position the layer relative to the top-left corner; opacity as either a 32-bit unsigned (0-255 scale) or a floating-point value (0.0-1.0) for transparency control; blending mode as a 32-bit unsigned (e.g., 0 for , 23 for overlay); and linked status as a 32-bit unsigned (1 for linked, 0 otherwise), though this has been deprecated since version 16 in favor of item sets. The layer's data consists of the array described above, typically in RGB or formats depending on the image precision, while any attached layer is represented as an additional channel structure with its own properties and data. Channels extend the layer structure by storing auxiliary information, such as selections or , separate from the main data. Standard selection channels use a single byte per (0-255 values, where 255 indicates full selection), with bilevel (binary) or full support for precise masking. Auxiliary channels, which can represent complex selections or paintable areas, include properties like a descriptive name, the same dimensions as the , and optional color tags specified as RGB byte triples or floating-point RGB values for visualization. These channels are stored similarly to layers, with their own tile-based data, allowing for multiple overlapping in advanced workflows. Hierarchical organization is enhanced through layer groups and paths, enabling nested compositions and vector elements. Introduced in version 3, layer groups act as container drawables flagged by a group item property, allowing layers to be nested with paths identifying their position in the hierarchy (e.g., via slash-separated strings like "group/layer"). Paths, used for precise selections or , are stored as collections of Bézier curves defined by control points (type 1 anchors), with properties for stroke width, fill rules, and anchoring to specific layers or the image. This vector data supports scalable elements without rasterization until rendering. Parasites provide a flexible mechanism for attaching arbitrary metadata to images, layers, or channels, stored as key-value pairs in a dedicated . Each parasite is identified by a unique name (e.g., "gimp-undo-history" for edit tracking or "gimp-plugin-state" for tool settings), with a variable-length binary value that can hold serialized data like XML or custom structures. This system allows plugins and features to persist non-pixel information without altering the core structure, ensuring extensibility across versions.

Compression and Storage

The pixel data in XCF files is organized into 64×64 tiles and compressed using one of three specified methods to balance file size and processing efficiency. Compression type 0 stores the tile data uncompressed, preserving the raw values in row-major order (top-to-bottom, left-to-right) with each encoded as BGR(A) bytes—blue, green, , and alpha (if present) as the final byte for images with transparency support. Type 1 applies (RLE), the default method in current versions, which processes each tile by separating the data into byte planes: it first encodes all first bytes (e.g., blue channel) across the tile in row-major order, then all second bytes (green), and so on for and alpha. This RLE scheme uses variable-length to represent runs of identical bytes—short runs (1–127 repetitions) with a single byte followed by the value, and longer runs with additional bytes for the count—efficiently compressing sequences of repeated values, including zeros that may arise in transparent or uniform areas. Type 2 compression, introduced in XCF version 4 alongside support for 64-bit file offsets, employs the zlib deflate algorithm to compress the entire raw tile data block as a single stream, again in BGR(A) row-major order without byte-plane separation. This method typically achieves better compression ratios than RLE for complex images, though it requires more computational resources for encoding and decoding, and is optional in implementations since version 2.10.0. The compression type for each or layer is specified via the PROP_COMPRESSION property in the file structure, allowing mixed usage within a single file if needed, though uniform application is standard. Non-pixel elements, including layer properties (such as name, opacity, and mode) and parasite attachments (metadata like color profiles or application-specific data), are stored without compression as simple serialized strings, integers, or other primitive types to ensure quick access and . This uncompressed storage prioritizes readability and compatibility over size reduction for , which typically constitutes a small portion of the file compared to pixel tiles. Beyond internal methods, XCF files support external compression wrappers applied by GIMP, such as or , producing variants like .xcf.gz that encapsulate the entire uncompressed XCF stream. These wrappers can reduce file sizes by a factor of 10 or more without , leveraging general-purpose algorithms suitable for the format's structure, and are particularly useful for archiving or transfer while maintaining full editability upon decompression.

Usage and Compatibility

Role in GIMP

The XCF file format serves as 's native format, functioning as the default option for saving new images and preserving all editable elements for seamless reopening without data loss. This design allows users to maintain full project integrity, including layers, channels, paths, and transparency, enabling continued editing in subsequent sessions. In 's , XCF facilitates non-destructive editing by retaining structural components such as multiple layers—each with their own properties like opacity and —and guides for alignment. Additional data, known as parasites, can be attached to images or layers to store extended information, such as metadata or plugin-specific details, further supporting processes. The active selection is preserved to restore the image state, but tool settings such as brush settings are not saved; history remains session-specific and is not saved. When saving an XCF file, offers options for compression using RLE or zlib algorithms to optimize , a to ensure readability in older versions, and the ability to embed thumbnails for quick previews. Upon loading, parses the file to reconstruct the exact session state, including floating selections, layer hierarchies, and positioned guides, allowing users to resume work precisely where they left off. Best practices recommend using XCF exclusively for work-in-progress files to leverage its comprehensive preservation capabilities, while exporting to formats like or for final distribution, as XCF is not intended for interchange with other software.

Third-Party Software Support

While remains the primary application with full native support for the XCF format, several third-party tools offer partial compatibility for viewing, importing, or converting XCF files. , a , provides import support for XCF files, preserving layers and guides to maintain much of the working environment, though it does not handle GIMP-specific metadata known as "parasites." This allows users to open and edit basic XCF content in before saving in its native KRA format or exporting to other standards. Vector-focused software like supports XCF primarily through an extension for exporting Inkscape documents to XCF, which requires to be installed on the system for the conversion process; direct import of XCF into is limited to extracting paths if present, but raster layers are not fully rendered. For raster conversion and basic viewing, enables reading XCF files to perform operations like resizing or format conversion, though it lacks support for multiple layers or color indexing, restricting it to single-layer, non-indexed images. Similarly, uses a dedicated plugin (version 0.1.5) to read XCF files, displaying composite views suitable for quick previews but without layer access. Online tools such as Jumpshare's XCF Viewer and ezyZip provide browser-based rendering of XCF files without installation, often flattening layers into a single image for display or download as , making them useful for casual viewing but inadequate for editing complex projects. also supports reading XCF as a format, enabling thumbnail generation and basic navigation, though multilayer files may not display all layers correctly. Most third-party implementations lose advanced XCF features, such as layer groups, high-bit-depth data, or parasites, leading to incomplete fidelity upon import or export; this instability discourages using XCF for production workflows outside GIMP, where conversion to formats like PSD or is recommended for interchange. Plugins for typically rely on GIMP-to-PSD converters rather than direct XCF handling, as no native plugin exists for opening XCF in Photoshop. , a , maintains an incompatible variant of the XCF format due to its extensions for , preventing seamless between the two. With the release of GIMP 3.0 in March 2025, third-party support is gradually improving through updated filters and libraries, yet XCF remains inherently GIMP-centric for reliable feature preservation.
Add your contribution
Related Hubs
User Avatar
No comments yet.