{"id":"image-x-compressed-xcf","mimeType":"image/x-compressed-xcf","name":"Compressed GIMP XCF Image","shortName":"Compressed-XCF","category":"Raster Graphics \u0026 Project Files","extensions":[".xcf.gz",".xcf.bz2",".xcfgz",".xcfbz2"],"description":"The image/x-compressed-xcf MIME type represents a compressed version of the XCF (eXperimental Computing Facility) file format, which is the native working project format for GIMP (GNU Image Manipulation Program). Because standard XCF files store complex, multi-layered pixel data with only basic RLE (Run-Length Encoding) compression, they can become extremely large. To mitigate this, GIMP natively supports saving and opening these files wrapped in standard gzip (.xcf.gz) or bzip2 (.xcf.bz2) compression algorithms, significantly reducing file sizes while maintaining all editable layers, masks, paths, and channels.","seo":{"title":"image/x-compressed-xcf MIME Type | Developer Reference for GIMP","description":"Complete reference for the image/x-compressed-xcf MIME type: Compressed GIMP XCF project files, gzip and bzip2 wrappers, and magic byte detection.","faqs":[{"question":"What is an .xcf.gz file?","answer":"An .xcf.gz file is a GIMP XCF project file that has been compressed using the gzip algorithm to save disk space. GIMP handles the compression and decompression automatically in the background when you save or open the file."},{"question":"How do I extract or open an image/x-compressed-xcf file?","answer":"You can open it directly in GIMP, which natively understands the compression wrapper. Alternatively, because it is just a standard archive, you can use extraction tools like 7-Zip, WinRAR, or the Linux 'gunzip' command to extract the raw, uncompressed .xcf file."},{"question":"Can I view an .xcf.bz2 file in a web browser?","answer":"No. Web browsers do not support the GIMP XCF format, nor do they natively decompress arbitrary bzip2 image archives. You must export the image to a web-safe format like WebP, PNG, or JPEG from within GIMP."}]},"index":{"compression":["Gzip (Deflate)","Bzip2"],"browserSupport":{"score":1,"label":"None"},"commonUses":["GIMP Multi-layer Project Archival","Saving disk space for complex raster edits","Open-source graphic design workflows"]},"technical":{"magicBytes":{"hex":"1F 8B 08 (gzip) or 42 5A 68 (bzip2)","ascii":"\\x1F\\x8B\\x08 or BZh"},"container":"Gzip or Bzip2 Archive","compressionAlgorithm":["Deflate","BWT (Burrows-Wheeler)"],"colorDepth":["8-bit (Per Channel)","16-bit (Integer/Floating Point)","32-bit (Integer/Floating Point)"],"transparency":true,"animation":true,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":true},"history":{"developer":"The GIMP Team","released":"1995","specification":"GIMP Developer Wiki (XCF Specification)"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"GIMP","logo":""},{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"7-Zip / GNU gzip (For extraction)","logo":""}],"conversion":{"convertTo":["png","jpeg","webp","tiff","psd"],"convertFrom":["xcf","psd","tiff"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/x-compressed-xcf"},{"header":"Content-Type","value":"application/x-gzip"}],"htmlAccept":"image/x-compressed-xcf, .xcf.gz, .xcf.bz2","fileDetection":["Because the file is compressed, it will NOT start with the standard 'gimp xcf' magic string.","It will start with standard archive headers: 1F 8B 08 for gzip, or 42 5A 68 for bzip2.","To verify it is actually a compressed XCF, you must decompress the stream in memory and check the first 9 bytes of the extracted payload for the ASCII string 'gimp xcf ' (Hex: 67 69 6D 70 20 78 63 66 20)."]},"prosCons":{"pros":["Drastically reduces the massive file sizes of standard XCF project files, saving significant disk space","Preserves 100% of the non-destructive editing data (layers, masks, paths, guides) from the GIMP workspace","Uses standard, universally supported compression algorithms (gzip/bzip2) meaning the archive can be rescued or extracted by standard OS tools if GIMP is unavailable"],"cons":["Increases file load and save times due to the CPU overhead required to compress and decompress the massive pixel arrays","Impossible for automated tools to parse metadata or dimensions without first unarchiving the payload into memory","File extension combinations (.xcf.gz) can confuse basic MIME sniffers which stop reading at the .gz extension"]},"specifications":{"url":"https://gitlab.gnome.org/GNOME/gimp/-/blob/master/devel-docs/xcf.txt","rfc":"","mimeAliases":["application/x-xcf-compressed","image/xcf"]},"developerSnippets":{"python":"import gzip\nimport magic\n\n# Identify the outer wrapper\nfile_type = magic.from_file('project.xcf.gz', mime=True)\nprint(f'Outer format: {file_type}') # Likely 'application/gzip'\n\n# Validate the inner payload\nwith gzip.open('project.xcf.gz', 'rb') as f:\n    inner_magic = f.read(9)\n    is_xcf = inner_magic == b'gimp xcf '\n    print(f'Contains valid XCF: {is_xcf}')","nodejs":"const fs = require('fs');\nconst zlib = require('zlib');\n\nconst stream = fs.createReadStream('project.xcf.gz');\nconst unzip = zlib.createGunzip();\n\nstream.pipe(unzip).once('data', (chunk) =\u003e {\n    const isXCF = chunk.toString('ascii', 0, 9) === 'gimp xcf ';\n    console.log('Is compressed XCF:', isXCF);\n    unzip.destroy();\n    stream.destroy();\n});","go":"import (\n    \"compress/gzip\"\n    \"os\"\n    \"bytes\"\n)\n// Open the file and pass it to gzip.NewReader\n// Read the first 9 bytes of the uncompressed stream\n// isXCF := bytes.Equal(uncompressedBuf[:9], []byte(\"gimp xcf \"))","php":"$mime = mime_content_type('project.xcf.gz');\necho $mime; // Standard PHP setups will return 'application/x-gzip'. You must use the zlib extension to read the internal payload."},"relatedFormats":["xcf","psd","gz"]}
