xcf2png (1) - Linux Manuals
xcf2png: convert from GIMP xcf files to png format
Command to display
xcf2png manual in Linux:
$ man 1 xcf2png
xcf2png - convert from GIMP xcf files to png format
is a command-line tool that converts image files in the XCF format used by
to the generic image format
flattening layers if necessary. It does not need to have
the Gimp engine itself available.
- -A, --force-alpha
Invent a trivial alpha channel even if the flattened image is
- -b color, --background color
Use this color for transparent pixels in the image.
The color can be given as
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).
- -c, --color, --colour
Force the output to use RGB color space even if it there are
more compact alternatives.
- -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
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
is also given, this happens before the background color is applied.
- -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.
- -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 status 103.
This will be selected automatically if the output file's name
- -G, --for-gif
Assert that the flattened image will have no partial transparency
(allowing a more compact representation of the alpha output).
Exit with status 102 if the flattened image has any partial
is also given, this tests whether there there is partial
transparency before applying the background color.
- -h, --help
Print an option summery to standard output and exit with a
return code of 0.
- -j, --bzip
Default if the filename ends with
- -o filename, --output filename
Write the converted picture to
instead of to standard output.
- -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 wxh, --size wxh
Crop the converted image to width w and height h.
- -T, --truecolor
Use standard RGB compositing for flattening indexed layers.
Without this option,
will mimic the Gimp's current strategy of rounding each
alpha value to either full transparency or full opacity,
and interpret all layer modes as
- -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.
- -v, --verbose
Print progress messages about the conversion to standard error.
- -V, --version
Print the version numer of
to standard output and exit with a return code of 0.
- -z, --gzip
Default if the filename ends with
- -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 as
and must produce output to its standard output.
Note that it is not possible to specify arguments as part of
An uncompressor is selected automatically if the filename ends
to suppress this, use
(which is implemented without actually starting a
Several groups of options are mutually incompatible; in each group the
one given last will win:
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
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.
The following options can be given
a layer name to override the global properties of the layer:
Enable the layer mask.
- --mode mode
Set the layer mode (e.g.,
Disable the layer mask.
- --opacity n
Set the opacity on a scale from 0 to 255 (as used internally)
- --percent n
Set the opacity on a scale from 0 to 100
(as in the Gimp user interface).
The exit status of
Problems parsing the command line, including unknown color names
(or missing color name directory) for
The specified XCF file does not exist or cannot be read.
A layer named on the command line was not found, or the
option was used for a layer that has no layer mask.
option was given, yet partial transparency was found.
was given, yet colored pixels were found.
The XCF file contains presumably valid features that
does 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
The XCF file is malformed.
An uncompression program could not be executed, or terminated
Unexpected I/O error, internal errors, or other "this can't happen"
If an uncompression program returns an error exit status, this will
be returned from
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
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.
Floating selections are currently not handled correctly.
There are probably other bugs lurking in corner cases. If you discover
one, please notify the author.
Color name database for
was written by Henning Makholm <henning [at] makholm.net>.