1xcf2png(1)                                                          xcf2png(1)
2
3
4

NAME

6       xcf2png - convert from GIMP xcf files to png format
7

SYNOPSIS

9       xcf2png [ options ] filename [ layer names ]
10

DESCRIPTION

12       xcf2png  is  a  command-line  tool that converts image files in the XCF
13       format used by gimp(1) to the generic image format png, flattening lay‐
14       ers  if  necessary.  It  does  not  need to have the Gimp engine itself
15       available.
16

GENERAL OPTIONS

18       -A, --force-alpha
19               Invent a trivial alpha channel even if the flattened  image  is
20               completely opaque.
21
22       -b color, --background color
23               Use  this color for transparent pixels in the image.  The color
24               can be given as #rrggbb or #rgb hexadecimal values,  or  as  an
25               X11  color  name (which will only work if a color name database
26               can be found in one of a number of standard locations).
27
28       -c, --color, --colour
29               Force the output to use RGB color space even if  it  there  are
30               more compact alternatives.
31
32       -C, --autocrop
33               Set  the  converted part of the image such that it just include
34               the boundaries of the visible (or selected) layers.   This  may
35               make  it either smaller or larger than the canvas, depending on
36               the position and size of the visible layers.   (Note  that  the
37               contents of the layers is not taken into account when autocrop‐
38               ping).
39
40               In the absence of options that specify otherwise, the converted
41               image will cover the entire XCF canvas.
42
43       -D, --dissolve
44               Do  a  "dissolve"  step to eliminate partial transparency after
45               flattening.  If -b is also given, this happens before the back‐
46               ground color is applied.
47
48       -f, --full-image
49               First  flatten the entire image to a memory buffer before writ‐
50               ing output. Then analyse the image to decide on the details  of
51               the  output  format (e.g., whether a grayscale output is suffi‐
52               cient).  Without this option, the program flattens only a singe
53               row of "tiles" (height 64) at a time.
54
55       -g, --gray, --grey
56               Force  the  output  to  be  a grayscale image even if it may be
57               monochrome.  If any colored pixels are encountered,  exit  with
58               status  103.  This will be selected automatically if the output
59               file's name ends with .pgm.
60
61       -G, --for-gif
62               Assert that the flattened image will  have  no  partial  trans‐
63               parency  (allowing  a  more compact representation of the alpha
64               output).  Exit with status 102 if the flattened image  has  any
65               partial  transparency.  If -b is also given, this tests whether
66               there there is partial transparency before applying  the  back‐
67               ground color.
68
69       -h, --help
70               Print  an  option  summery  to  standard output and exit with a
71               return code of 0.
72
73       -j, --bzip
74               Equivalent to -Z bzcat.  Default if the filename ends with bz2.
75
76       -o filename, --output filename
77               Write the converted picture to filename instead of to  standard
78               output.
79
80       -O x,y, --offset x,y
81               Offset the converted part of the image from the top-left corner
82               of the XCF canvas. Usually used with -S.
83
84       -S wxh, --size wxh
85               Crop the converted image to width w and height h.
86
87       -T, --truecolor
88               Use standard RGB compositing  for  flattening  indexed  layers.
89               Without  this  option,  xcf2png  will  mimic the Gimp's current
90               strategy of rounding each alpha value  to  either  full  trans‐
91               parency  or full opacity, and interpret all layer modes as Nor‐
92               mal.
93
94       -u, --utf8
95               Use the raw UTF-8 representation from the XCF file  to  compare
96               and  display layer names.  Ordinarily, layer names will be con‐
97               verted to the character set of the current locale.
98
99       -v, --verbose
100               Print progress messages about the conversion to standard error.
101
102       -V, --version
103               Print the version numer of xcftools to standard output and exit
104               with a return code of 0.
105
106       -z, --gzip
107               Equivalent to -Z zcat.  Default if the filename ends with gz.
108
109       -Z command, --unpack command
110               Specify  a  command  that  the  input  file is filtered through
111               before being interpreted as an XCF file. The command is invoked
112               as  command  filename  and  must produce output to its standard
113               output.  Note that it is not possible to specify  arguments  as
114               part  of command.  An uncompressor is selected automatically if
115               the filename ends with gz or bz2; to suppress this, use -Z  cat
116               (which  is  implemented  without  actually  starting  a  cat(1)
117               process).
118
119       Several groups of options are mutually incompatible; in each group  the
120       one given last will win:
121
122       1)  -A and -b.
123
124       2)  -g and -c .
125
126       3)  -D and -G.
127
128       4)  -j, -z, and -Z.
129
130       5)  -C and -O/-S.
131

LAYER SPECIFICATIONS

133       If  no layer name is given on the command line, all of the visible lay‐
134       ers in the XCF file are merged to produce the output image.  It is also
135       possible  to  specify  the  layers to merge explicitly, by giving their
136       names as separate arguments after the input filename. In that case, the
137       output will contain only the named layers. The layers will be merged in
138       the order they appear on the command line, with the leftmost being  "at
139       the  bottom"  -  that  is,  the  layer ordering in the XCF file will be
140       ignored.
141
142       The following options can be given after a layer name to  override  the
143       global properties of the layer:
144
145       --mask  Enable the layer mask.
146
147       --mode mode
148               Set the layer mode (e.g., Normal or Multiply).
149
150       --nomask
151               Disable the layer mask.
152
153       --opacity n
154               Set the opacity on a scale from 0 to 255 (as used internally)
155
156       --percent n
157               Set  the  opacity on a scale from 0 to 100 (as in the Gimp user
158               interface).
159

EXIT STATUS

161       The exit status of xcf2png is
162
163       0    Success
164
165       20   Problems parsing the command line, including unknown  color  names
166            (or missing color name directory) for -b.
167
168       21   The specified XCF file does not exist or cannot be read.
169
170       22   A  layer  named  on  the command line was not found, or the --mask
171            option was used for a layer that has no layer mask.
172
173       102  The -G option was given, yet partial transparency was found.
174
175       103  -g was given, yet colored pixels were found.
176
177       123  The XCF file contains presumably valid features that xcftools does
178            not support.  (As of this writing there is no known way of getting
179            the Gimp to write an XCF  file  that  will  provoke  this  return.
180            Please notify the author if you discover one).
181
182       125  The XCF file is malformed.
183
184       126  An  uncompression  program  could  not  be executed, or terminated
185            abnormally.
186
187       127  Unexpected I/O error, internal errors, or other "this  can't  hap‐
188            pen" situations.
189
190       If  an uncompression program returns an error exit status, this will be
191       returned from xcf2png too.
192

BUGS AND LIMITATIONS

194       When several partially transparent layers are merged, the pixel  values
195       are  interpolated without gamma correction. (The Gimp also does it this
196       way). Some slight rounding errors in the interpolation are  inevitable;
197       xcf2png  sometimes  has different rounding errors than the Gimp itself,
198       especially when more than two layers are involved, or in case  of  some
199       of the more exotic layer modes.  These differences are usually not vis‐
200       ible to the eye.
201
202       Floating selections are currently not handled correctly.
203
204       There are probably other bugs lurking in corner cases. If you  discover
205       one, please notify the author.
206
207

FILES

209       /etc/X11/rgb.txt
210
211       /usr/share/X11/rgb.txt
212
213       /usr/lib/X11/rgb.txt
214               Color name database for -b.
215

AUTHOR

217       xcf2png was written by Henning Makholm <henning@makholm.net>.
218

SEE ALSO

220       xcfinfo(1), xcf2pnm(1)
221
222
223
224Xcftools                          2006-02-12                        xcf2png(1)
Impressum