xcf2png(1)
π¦ xcf2png β the manual page, bestie edition β¨
Okay so this is xcf2png(1), and if you've ever been stuck with a GIMP file and no GIMP, this is literally your girl π
πΈ NAME πΈ
xcf2png β convert from GIMP xcf files to png format π
β¨ SYNOPSIS β¨
xcf2png [ options ] filename [ layer names ]
π DESCRIPTION π
xcf2png is a command-line tool that converts image files in the XCF format used by gimp(1) to the generic image format png, flattening layers if necessary. And the iconique part? It does not need the Gimp engine itself to be available. No Gimp, no problem, periodt. π
π«Ά GENERAL OPTIONS π«Ά
-A,--force-alphaβ Invent a trivial alpha channel even if the flattened image is completely opaque. Giving it alpha when it doesn't need alpha, because sometimes you just want the option, yk? β¨-b color,--background colorβ Use this color for transparent pixels in the image. The color can be given as#rrggbbor#rgbhexadecimal values, or as an X11 color name (which will only work if a color name database can be found in one of a number of standard locations). So cute, so specific π-c,--color,--colourβ Force the output to use RGB color space even if it there are more compact alternatives. Yes bestie, spell it however you want, both--colorand--colourare iconic π-C,--autocropβ Set the converted part of the image such that it just include the boundaries of the visible (or selected) layers. This may make it either smaller or larger than the canvas, depending on the position and size of the visible layers. (Note that the contents of the layers is not taken into account when autocropping.) π¦
In the absence of options that specify otherwise, the converted image will cover the entire XCF canvas.
-D,--dissolveβ Do a "dissolve" step to eliminate partial transparency after flattening. If-bis also given, this happens before the background color is applied. Order matters, bestie π-f,--full-imageβ First flatten the entire image to a memory buffer before writing output. Then analyse the image to decide on the details of the output format (e.g., whether a grayscale output is sufficient). Without this option, the program flattens only a singe row of "tiles" (height 64) at a time. Lowkey the thorough-girlie option π§-g,--gray,--greyβ Force the output to be a grayscale image even if it may be monochrome. If any colored pixels are encountered, exit with status103. This will be selected automatically if the output file's name ends with.pgm. Gray/grey, we contain multitudes π-G,--for-gifβ Assert that the flattened image will have no partial transparency (allowing a more compact representation of the alpha output). Exit with status102if the flattened image has any partial transparency. If-bis also given, this tests whether there there is partial transparency before applying the background color. Manifesting full transparency only π-h,--helpβ Print an option summery to standard output and exit with a return code of0. The classic "help me help you" π-j,--bzipβ Equivalent to-Z bzcat. Default if the filename ends withbz2. π-o filename,--output filenameβ Write the converted picture to filename instead of to standard output. Redirect, but make it fashion β¨-O x,y,--offset x,yβ Offset the converted part of the image from the top-left corner of the XCF canvas. Usually used with-S. The "nudge it a bit" of it all π-S wxh,--size wxhβ Crop the converted image to width w and height h. Crop crop crop πΈ-T,--truecolorβ Use standard RGB compositing for flattening indexed layers. Without this option,xcf2pngwill mimic the Gimp's current strategy of rounding each alpha value to either full transparency or full opacity, and interpret all layer modes as Normal. Respect the Gimp's choices, or don't π-u,--utf8β Use the raw UTF-8 representation from the XCF file to compare and display layer names. Ordinarily, layer names will be converted to the character set of the current locale. Names are important, fr fr π-v,--verboseβ Print progress messages about the conversion to standard error. She's chatty and that's valid π-V,--versionβ Print the version numer of xcftools to standard output and exit with a return code of0. Know your icon's version number, always π-z,--gzipβ Equivalent to-Z zcat. Default if the filename ends withgz. β-Z command,--unpack commandβ Specify a command that the input file is filtered through before being interpreted as an XCF file. The command is invoked ascommand filenameand must produce output to its standard output. Note that it is not possible to specify arguments as part of command. An uncompressor is selected automatically if the filename ends withgzorbz2; to suppress this, use-Z cat(which is implemented without actually starting acat(1)process). Sneaky efficient π§
Now the important relationship-drama section: several groups of options are mutually incompatible, and in each group the one given last will win π
-Aand-b.-gand-c.-Dand-G.-j,-z, and-Z.-Cand-O/-S.
π¦ LAYER SPECIFICATIONS π¦
If no layer name is given on the command line, all of the visible layers in the XCF file are merged to produce the output image. It is also possible to specify the layers to merge explicitly, by giving their names as separate arguments after the input filename. In that case, the output will contain only the named layers. The layers will be merged in the order they appear on the command line, with the leftmost being "at the bottom" β that is, the layer ordering in the XCF file will be ignored. You're the main character now, you choose the stacking order π
The following options can be given after a layer name to override the global properties of the layer:
--maskβ Enable the layer mask. π--mode modeβ Set the layer mode (e.g.,NormalorMultiply). Choose your vibe β¨--nomaskβ Disable the layer mask. π--opacity nβ Set the opacity on a scale from0to255(as used internally). Nerd numbers, we respect them π§--percent nβ Set the opacity on a scale from0to100(as in the Gimp user interface). Human-friendly numbers, we love them π
π₯ EXIT STATUS π₯
The exit status of xcf2png is:
0β Success. Slay. β20β Problems parsing the command line, including unknown color names (or missing color name directory) for-b. π21β The specified XCF file does not exist or cannot be read. Been there π22β A layer named on the command line was not found, or the--maskoption was used for a layer that has no layer mask. Ghosted, literally π»102β The-Goption was given, yet partial transparency was found. Caught in 4K π103β-gwas given, yet colored pixels were found. The colors were not invited to the grayscale party π123β The XCF file contains presumably valid features thatxcftoolsdoes not support. (As of this writing there is no known way of getting the Gimp to write an XCF file that will provoke this return. Please notify the author if you discover one). You'd be a legend, ngl π125β The XCF file is malformed. It's giving corrupted π«126β An uncompression program could not be executed, or terminated abnormally. Not the uncompresser behaving badly π€127β Unexpected I/O error, internal errors, or other "this can't happen" situations. And yet π
Heads up bestie: if an uncompression program returns an error exit status, this will be returned from xcf2png too. No covering for your friends π«Ά
π BUGS AND LIMITATIONS π
When several partially transparent layers are merged, the pixel values are interpolated without gamma correction. (The Gimp also does it this way). Some slight rounding errors in the interpolation are inevitable; xcf2png sometimes has different rounding errors than the Gimp itself, especially when more than two layers are involved, or in case of some of the more exotic layer modes. These differences are usually not visible to the eye. Tiny, microscopic, invisible drama only π¬β¨
Floating selections are currently not handled correctly. Floating, unhandled, iconic π
There are probably other bugs lurking in corner cases. If you discover one, please notify the author. Be the bug reporter you wish to see in the world π«‘
π FILES π
/etc/X11/rgb.txt/usr/share/X11/rgb.txt/usr/lib/X11/rgb.txt
Color name database for -b. That's where the X11 color names live, bestie π
π AUTHOR π
xcf2png was written by Henning Makholm <henning@makholm.net>. Legend behavior, honestly π«Ά
π SEE ALSO π
xcfinfo(1), xcf2pnm(1) β the whole friend group π
And that's the whole page, bestie! This little beauty comes from Xcftools, dated 2006-02-12, manual page xcf2png(1). Go convert something iconic β¨π
π
π¦ where this page comes from
- nixos 26.05: xcftools 1.0.7
- nixpkgs unstable: xcftools 1.0.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms