Recent from talks
Nothing was collected or created yet.
XCF (file format)
View on WikipediaThis article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
| XCF | |
|---|---|
![]() | |
| Filename extension |
.xcf |
| Internet media type |
image/x-xcf |
| Magic number | gimp xcf |
| Developed by | GIMP |
| Initial release | 15 December 1997 |
| Container for | Graphics |
| 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.
| 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]- ^
"Partial Specification of the XCF File Format". 2006-07-11. Retrieved 2014-05-21.
The name XCF honors GIMP's origin at the eXperimental Computing Facility of the University of California at Berkeley.
- ^ a b "About". Seashore. Retrieved 2015-01-03.
- ^ a b
"Inkscape 0.44 Release Notes".
The new XCF output extension exports all top-level elements (i.e. layers and objects directly under root) as PNGs and assembles them into an XCF for processing in GIMP.
- ^ a b "IrfanView formats". Irfanview.com. Retrieved 1 March 2014.
- ^ a b "Commons:File types - Wikimedia Commons". commons.wikimedia.org. Wikimedia Commons. Retrieved 23 June 2020.
- ^ a b "Source code for SDL's XCF Loader". hg.libsdl.org. Retrieved 2018-06-09.
- ^ Neumann, Sven (2001-12-16). "Re: XCF support added to ImageMagick". gimp-developer (Mailing list).
External links
[edit]XCF (file format)
View on GrokipediaOverview
Introduction
The XCF file format, an acronym for eXperimental Computing Facility, serves as the native image format for GIMP (GNU Image Manipulation Program), the open-source raster graphics editor originally developed at the University of California, Berkeley.[1] 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.[1][3] This layered raster format inherently supports transparency via alpha channels and facilitates non-destructive editing by isolating modifications to individual layers and layer masks (with support for non-destructive filters since GIMP 3.0), while accommodating images across a range of resolutions defined by the canvas dimensions and pixel depth.[3][1] XCF files are identified by the primary .xcf extension, with GIMP offering optional compression variants like .xcf.gz (gzip) and .xcf.bz2 (bzip2) to optimize storage without altering the data integrity.[1]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 blend modes including Normal, Multiply, and Soft Light, and layer masks for non-destructive editing.[1] 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.[1] 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.[1] These features facilitate the integration of scalable vector graphics 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.[1] Hierarchical organization 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.[1] XCF accommodates varying precision levels per channel, including 8-bit integer for standard images, 16-bit for enhanced detail, and floating-point (32-bit or 64-bit, in linear or gamma-corrected modes) to handle high dynamic range (HDR) content. The format also supports non-destructive filters applied to layers since GIMP 3.0 (March 2025).[1][4] Compression options, such as RLE or zlib, are available to optimize file size while maintaining these features.[1]History and Development
Origins and Evolution
The XCF file format was developed in 1997 as the native format for the GNU Image Manipulation Program (GIMP), emerging alongside the software's early versions to address the limitations of ad-hoc saving methods used in prior releases.[5] 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 PNG or JPEG, which prioritize compression over editability.[5][1] This motivation stemmed from GIMP's origins as a free alternative to proprietary image editors, where maintaining workflow continuity was essential for users and developers alike.[1] Over time, the XCF format has evolved in close tandem with GIMP'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 GIMP incorporated new tools and user demands.[1] These changes reflect a commitment to adaptability, ensuring XCF could handle increasingly complex image manipulations without losing backward compatibility for core elements.[1] Maintenance of XCF is managed directly by the GIMP 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.[1] Notably, XCF differs from variants like the one extended by CinePaint, which introduced proprietary modifications rendering it incompatible with standard GIMP implementations.[6]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.[1] Version 1, released concurrently, extended this by adding support for color maps via thePROP_COLOR_MAP property.[1]
Version 2 arrived with GIMP 1.3.10 on November 7, 2002, introducing new layer blend modes 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.[1] 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.[1]
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.[1]
Subsequent versions 14 through 25, starting with GIMP 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.[1] 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.[1]
The format maintains strong backward compatibility, allowing newer GIMP versions to open and render older XCF files, though advanced features from later versions may degrade or be ignored in earlier software releases.[7]
Technical Specifications
File Header
The XCF file format begins with a fixed header that identifies the file and provides essential metadata about the image. 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 extended precision and larger file sizes.[8] Following the version, the header includes two 32-bit unsigned integers representing the image width and height in pixels, defining the canvas dimensions. A 32-bit unsigned integer specifies the image type: 0 for RGB color, 1 for grayscale, or 2 for indexed color mode. Since version 4, an additional 32-bit unsigned integer field denotes the precision, indicating bits per channel and the encoding type (e.g., 100 for 8-bit linear integer or 750 for 64-bit gamma floating point); in earlier versions (0–3), this field is absent, defaulting to 8-bit gamma integer precision.[8] The header also contains metadata on compression and structural elements. A property (PROP_COMPRESSION) specifies the compression type for tile data: 0 for no compression, 1 for run-length encoding (RLE, available since version 1), 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.[8]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 image editing software like GIMP. After the file header, the core image data begins with a hierarchy 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.[8] Pixel data within the XCF format is stored using a tile-based system, where the image canvas is divided into non-overlapping tiles 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 image at once. Compression is applied to these tile data blocks, though the specific encoding varies by version.[8] Layers form the primary building blocks of the image hierarchy, with each layer defined by a series of properties followed by its pixel data. Key properties include a UTF-8 encoded name stored as a variable-length string for identification; width and height as 32-bit unsigned integers matching or subsetting the canvas size; x and y offsets as 32-bit signed integers to position the layer relative to the canvas top-left corner; opacity as either a 32-bit unsigned integer (0-255 scale) or a floating-point value (0.0-1.0) for transparency control; blending mode as a 32-bit unsigned integer (e.g., 0 for normal mode, 23 for overlay); and linked status as a 32-bit unsigned integer (1 for linked, 0 otherwise), though this has been deprecated since version 16 in favor of item sets. The layer's pixel data consists of the tile array described above, typically in RGB or grayscale formats depending on the image precision, while any attached layer mask is represented as an additional channel structure with its own properties and tile data. Channels extend the layer structure by storing auxiliary information, such as selections or masks, separate from the main pixel data. Standard selection channels use a single byte per pixel (0-255 grayscale values, where 255 indicates full selection), with bilevel (binary) or full grayscale 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 canvas, 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 pixel data, allowing for multiple overlapping masks 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 strokes, 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.[8] Parasites provide a flexible mechanism for attaching arbitrary metadata to images, layers, or channels, stored as key-value pairs in a dedicated property list. Each parasite is identified by a unique string 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 GIMP versions.[8]Compression and Storage
The pixel data in XCF files is organized into 64×64 pixel 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 pixel values in row-major order (top-to-bottom, left-to-right) with each pixel encoded as BGR(A) bytes—blue, green, red, and alpha (if present) as the final byte for images with transparency support. Type 1 applies run-length encoding (RLE), the default method in current GIMP 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 red and alpha. This RLE scheme uses variable-length opcodes to represent runs of identical bytes—short runs (1–127 repetitions) with a single opcode 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.[8] 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 GIMP implementations since version 2.10.0. The compression type for each tile 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.[10] 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 parsing. This uncompressed storage prioritizes readability and compatibility over size reduction for ancillary data, which typically constitutes a small portion of the file compared to pixel tiles.[8] Beyond internal methods, XCF files support external compression wrappers applied by GIMP, such as gzip or bzip2, producing variants like .xcf.gz that encapsulate the entire uncompressed XCF stream.[11] These wrappers can reduce file sizes by a factor of 10 or more without data loss, leveraging general-purpose algorithms suitable for the format's structure, and are particularly useful for archiving or transfer while maintaining full editability upon decompression.[11]Usage and Compatibility
Role in GIMP
The XCF file format serves as GIMP's native format, functioning as the default option for saving new images and preserving all editable elements for seamless reopening without data loss.[3] This design allows users to maintain full project integrity, including layers, channels, paths, and transparency, enabling continued editing in subsequent sessions.[3] In GIMP's workflow, XCF facilitates non-destructive editing by retaining structural components such as multiple layers—each with their own properties like opacity and blend modes—and guides for alignment.[3] 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 iterative design processes.[3] The active selection is preserved to restore the image state, but tool settings such as brush settings are not saved; undo history remains session-specific and is not saved.[3] When saving an XCF file, GIMP offers options for compression using RLE or zlib algorithms to optimize file size, a compatibility mode to ensure readability in older GIMP versions, and the ability to embed thumbnails for quick previews. Upon loading, GIMP 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.[3] Best practices recommend using XCF exclusively for work-in-progress files to leverage its comprehensive preservation capabilities, while exporting to formats like PNG or JPEG for final distribution, as XCF is not intended for interchange with other software.[3]Third-Party Software Support
While GIMP 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. Krita, a raster graphics editor, 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 Krita before saving in its native KRA format or exporting to other standards.[12] Vector-focused software like Inkscape supports XCF primarily through an extension for exporting Inkscape documents to XCF, which requires GIMP to be installed on the system for the conversion process; direct import of XCF into Inkscape is limited to extracting paths if present, but raster layers are not fully rendered. For raster conversion and basic viewing, ImageMagick 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.[13] Similarly, IrfanView uses a dedicated plugin (version 0.1.5) to read XCF files, displaying composite views suitable for quick previews but without layer access.[14] 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 PNG, making them useful for casual viewing but inadequate for editing complex projects.[15][16] XnView also supports reading XCF as a GIMP bitmap format, enabling thumbnail generation and basic navigation, though multilayer files may not display all layers correctly.[17] 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 PNG is recommended for interchange.[18] Plugins for Adobe Photoshop typically rely on GIMP-to-PSD converters rather than direct XCF handling, as no native plugin exists for opening XCF in Photoshop. CinePaint, a GIMP fork, maintains an incompatible variant of the XCF format due to its extensions for high-dynamic-range imaging, preventing seamless file sharing 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.[4]References
- https://gitlab.gnome.org/GNOME/[gimp](/page/GIMP)/-/tree/master/app/xcf

