1xcf2pnm(1)                                                          xcf2pnm(1)
2
3
4

NAME

6       xcf2pnm - convert from GIMP xcf files to ppm/pgm/pbm format
7

SYNOPSIS

9       xcf2pnm [ options ] filename [ layer names ]
10

DESCRIPTION

12       xcf2pnm  is  a  command-line  tool that converts image files in the XCF
13       format used by gimp(1) to the generic image formats pbm(5), pgm(5), and
14       ppm(5),  flattening  layers  if necessary. It does not need to have the
15       Gimp engine itself available.
16

GENERAL OPTIONS

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

LAYER SPECIFICATIONS

152       If  no layer name is given on the command line, all of the visible lay‐
153       ers in the XCF file are merged to produce the output image.  It is also
154       possible  to  specify  the  layers to merge explicitly, by giving their
155       names as separate arguments after the input filename. In that case, the
156       output will contain only the named layers. The layers will be merged in
157       the order they appear on the command line, with the leftmost being  "at
158       the  bottom"  -  that  is,  the  layer ordering in the XCF file will be
159       ignored.
160
161       The following options can be given after a layer name to  override  the
162       global properties of the layer:
163
164       --mask  Enable the layer mask.
165
166       --mode mode
167               Set the layer mode (e.g., Normal or Multiply).
168
169       --nomask
170               Disable the layer mask.
171
172       --opacity n
173               Set the opacity on a scale from 0 to 255 (as used internally)
174
175       --percent n
176               Set  the  opacity on a scale from 0 to 100 (as in the Gimp user
177               interface).
178

EXIT STATUS

180       The exit status of xcf2pnm is
181
182       0    Success
183
184       20   Problems parsing the command line, including unknown  color  names
185            (or missing color name directory) for -b.
186
187       21   The specified XCF file does not exist or cannot be read.
188
189       22   A  layer  named  on  the command line was not found, or the --mask
190            option was used for a layer that has no layer mask.
191
192       100  Transparent pixels were found, but neither -a nor -b was given.
193
194       101  The -a option was given yet the image has no  transparency.   (Use
195            -A to go on anyway).
196
197       102  The -G option was given, yet partial transparency was found.
198
199       103  -g (or -m) was given, yet colored (or gray) pixels were found.
200
201       123  The XCF file contains presumably valid features that xcftools does
202            not support.  (As of this writing there is no known way of getting
203            the  Gimp  to  write  an  XCF  file that will provoke this return.
204            Please notify the author if you discover one).
205
206       125  The XCF file is malformed.
207
208       126  An uncompression program could  not  be  executed,  or  terminated
209            abnormally.
210
211       127  Unexpected  I/O  error, internal errors, or other "this can't hap‐
212            pen" situations.
213
214       If an uncompression program returns an error exit status, this will  be
215       returned from xcf2pnm too.
216

EXAMPLES

218              xcf2pnm -b white foo.xcf > foo.ppm
219
220              xcf2pnm -a footrans.pgm -o foo.ppm foo.xcf Layer1 Layer2
221
222       To test whether the flattened image has any transparency, use
223
224              xcf2pnm foo.xcf > /dev/null
225
226       To  test  whether the flattened image has partially transparent pixels,
227       use
228
229              xcf2pnm -b white -G > /dev/null
230

BUGS AND LIMITATIONS

232       When several partially transparent layers are merged, the pixel  values
233       are  interpolated without gamma correction. (The Gimp also does it this
234       way). Some slight rounding errors in the interpolation are  inevitable;
235       xcf2pnm  sometimes  has different rounding errors than the Gimp itself,
236       especially when more than two layers are involved, or in case  of  some
237       of the more exotic layer modes.  These differences are usually not vis‐
238       ible to the eye.
239
240       Floating selections are currently not handled correctly.
241
242       There are probably other bugs lurking in corner cases. If you  discover
243       one, please notify the author.
244
245

FILES

247       /etc/X11/rgb.txt
248
249       /usr/share/X11/rgb.txt
250
251       /usr/lib/X11/rgb.txt
252               Color name database for -b.
253

AUTHOR

255       xcf2pnm was written by Henning Makholm <henning@makholm.net>.
256

SEE ALSO

258       xcfinfo(1), xcf2png(1)
259
260
261
262Xcftools                          2006-02-12                        xcf2pnm(1)
Impressum