1Giftopnm User Manual(0) Giftopnm User Manual(0)
2
3
4
6 giftopnm - convert a GIF file into a PNM image
7
8
10 giftopnm [--alphaout={alpha-filename,-}] [-verbose] [-comments]
11 [-image={N,all}] [-repair] [-quitearly] [GIFfile]
12
13 Minimum unique abbreviation of option is acceptable. You may use dou‐
14 ble hyphens instead of single hyphen to denote options. You may use
15 white space in place of the equals sign to separate an option name from
16 its value.
17
18
20 This program is part of Netpbm(1).
21
22 This is a graphics format converter from the GIF format to the PNM
23 (i.e. PBM, PGM, or PPM) format.
24
25 If the image contains only black and maximally bright white, the output
26 is PBM. If the image contains more than those two colors, but only
27 grays, the output is PGM. If the image contains other colors, the out‐
28 put is PPM.
29
30 A GIF image contains rectangular pixels. They all have the same
31 aspect ratio, but may not be square (it's actually quite unusual for
32 them not to be square, but it could happen). The pixels of a Netpbm
33 image are always square. Because of the engineering complexity to do
34 otherwise, giftopnm converts a GIF image to a Netpbm image pixel-for-
35 pixel. This means if the GIF pixels are not square, the Netpbm output
36 image has the wrong aspect ratio. In this case, giftopnm issues an
37 informational message telling you to run pamscale to correct the out‐
38 put.
39
40
42 In addition to the options common to all programs based on libnetpbm
43 (most notably -quiet, see
44 Common Options ⟨index.html#commonoptions⟩ ), giftopnm recognizes the
45 following command line options:
46
47
48
49 --alphaout=alpha-filename
50 giftopnm creates a PBM file containing the transparency infor‐
51 mation from the input image. This transparency image is the
52 same dimensions as the input image, and each pixel of the trans‐
53 parency image tells whether the corresponding pixel of the input
54 image is transparent. Black means transparent; white means
55 opaque. If you don't specify --alphaout, giftopnm does not gen‐
56 erate a transparency file, and if the input image has a trans‐
57 parency channel, giftopnm simply discards it.
58
59 If you specify - as the filename, giftopnm writes the trans‐
60 parency output to Standard Output and discards the image.
61
62 See pamcomp(1) for one way to use the transparency output file.
63
64
65 -verbose
66 Produce verbose output about the GIF file input.
67
68
69 -comments
70 With this option, giftopnm issues messages showing the GIF com‐
71 ments (A GIF89 stream can contain comments in comment exten‐
72 sions).
73
74 By default, giftopnm ignores comment extensions.
75
76
77
78 -image={N,all}
79 This option identifies which image from the GIF stream you want.
80 You can select either one image or all the images. Select all
81 the images with all. Select one image by specifying its
82 sequence number in the stream: 1, 2, 3, etc.
83
84 The default is just Image 1.
85
86 A GIF stream normally contains only one image, so you don't need
87 this option. But some streams, including animated GIFs, have
88 multiple images.
89
90 When you select multiple GIF images, the output is a PNM stream
91 with multiple images.
92
93 If you specify a single image, giftopnm must read and partially
94 validate the images before that in the stream. It may or may
95 not do the same for the images after it; see -quitearly.
96
97 The all value was added in Netpbm 10.16 (June 2003). Earlier
98 giftopnm can extract only one image.
99
100
101 -repair
102 This option makes giftopnm try to salvage what it can from an
103 invalid GIF input.
104
105 In particular, when giftopnm detects that the GIF input is
106 invalid so that it is impossible to determine what the pixels
107 are intended to be, it produces a single arbitrary color for all
108 further pixels in the image. giftopnm processes the image from
109 top to bottom, left to right, so this means the bottommost pix‐
110 els will be this padding.
111
112 giftopnm issues warning messages when it salvages an image in
113 this way.
114
115 Without this option, giftopnm fails when it detects invalid GIF
116 input. Any output it produces is arbitrary, and typically is
117 not a valid PNM image.
118
119 It is fairly common for an image to be corrupted such that is
120 started off as a valid GIF, but had the end of the file cut off.
121 An interrupted network transfer tends to do this. In this case,
122 giftopnm's salvage operation will produce a valid PNM image of
123 the proper dimensions, but with a single arbitrary color for the
124 pixels that were left out of the file.
125
126 This option was new in Netpbm 10.38 (March 2007). From 10.32
127 through 10.37, giftopnm always fails if it detects invalid GIF
128 input. Before 10.32, it succeeds in the case of a truncated
129 image, and replaces the missing pixels with arbitrary colors,
130 not necessarily all the same (The pre-10.32 behavior wasn't
131 actually intended by the design).
132
133
134
135 -quitearly
136 This option makes giftopnm stop reading its input file as soon
137 as it has converted and output the images from the input that
138 you requested. By default, giftopnm reads until the end of the
139 GIF stream, ignoring any data after the images you requested.
140
141 Two reasons not to use this option:
142
143
144 · The input file is a pipe and the process that is filling that
145 pipe expects the pipe to take the entire stream and will fail or
146 get stuck if it doesn't.
147
148
149 · You want to validate the entire GIF stream.
150
151
152
153 Two reasons to use this option:
154
155
156
157 · It saves the time and other resources to read the end of the
158 stream.
159
160 · There are errors in the end of the stream that make giftopnm
161 fail.
162
163
164 This option has no effect if you also specify -image=all
165
166 This option was new in Netpbm 10.35 (August 2006). Before that,
167 giftopnm always reads the entire stream.
168
169
170
171
173 This does not correctly handle the Plain Text Extension of the GIF89
174 standard, since I did not have any example input files containing them.
175
176
178 pamtogif(1), ppmcolormask(1), pamcomp(1), http://www.lcdf.org/gifsicle
179 ⟨http://www.lcdf.org/gifsicle⟩ , ppm(1).
180
181
183 Copyright (c) 1993 by David Koblas (koblas@netcom.com)
184
185
187 As a historical note, for a long time if you used giftopnm, you were
188 using a patent on the LZW compression method which was owned by Unisys,
189 and in all probability you did not have a license from Unisys to do so.
190 Unisys typically asked $5000 for a license for trivial use of the
191 patent. Unisys never enforced the patent against trivial users, and
192 made statements that it is much less concerned about people using the
193 patent for decompression (which is what giftopnm does than for compres‐
194 sion. The patent expired in 2003.
195
196 Rumor has it that IBM also owns a patent covering giftopnm.
197
198 A replacement for the GIF format that has never required any patent
199 license to use is the PNG format.
200
202 This manual page was generated by the Netpbm tool 'makeman' from HTML
203 source. The master documentation is at
204
205 http://netpbm.sourceforge.net/doc/giftopnm.html
206
207netpbm documentation 13 September 2012 Giftopnm User Manual(0)