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