1GIF2PNG(1) 20 September 1999 GIF2PNG(1)
2
3
4
6 gif2png - convert GIFs to PNGs
7
9 gif2png [-bdfghinprsvwO] [file.[gif]...]
10
12 The gif2png program converts files in the obsolescent Graphic
13 Interchange Format (GIF) to Portable Network Graphics (PNG) format, an
14 open W3C standard.
15
16 Normally gif2png converts each file named on the command line, leaving
17 the original in place. If a name does not have a .gif extension, the
18 unmodified name will be tried first, followed by the name with .gif
19 appended. For each file named `foo.gif´, a foo.png will be created.
20
21 When a multi-image GIF file named foo.gif is converted, gif2png creates
22 multiple PNG files, each containing one frame; their names will be
23 foo.png, foo.p01, foo.p02 etc.
24
25 If no source files are specified and stdin is a terminal, gif2png lists
26 a usage summary and version information, then exits.
27
28 If no source files are specified, and stdin is a device or pipe, stdin
29 is converted to noname.png. (The program can´t be a normal
30 stdin-to-stdout filter because of the possibility that the input GIF
31 might have multiple images).
32
33 However, if filter mode is forced (with -f) stdin will be converted to
34 stdout, with gif2png returning an error code if the GIF is multi-image.
35
36 The program will preserve the information contained in a GIF file as
37 closely as possible, including GIF comment and application-data
38 extension blocks. All graphics data (pixels, RGB color tables) will be
39 converted without loss of information. Transparency is also preserved.
40 There is one exception; GIF plain-text extensions are skipped.
41
42 The program automatically converts interlaced GIFs to interlaced PNGs.
43 It detects images in which all colors are gray (equal R, G, and B
44 values) and converts such images to PNG grayscale. Other images are
45 converted to use the PNG palette type. Duplicate color entries are
46 silently preserved. Unused color-table entries cause an error message.
47
48 The action of the program can be modified with the following
49 command-line switches:
50
51 -b {#}RRGGBB
52 Background. Replace transparent pixels with given RGB value, six
53 hexadecimal digits interpreted as two hexits each of red, green,
54 and blue value. The value may optionally be led with a #,
55 HTML-style.
56
57 -d
58 Delete source GIF files after successful conversion.
59
60 -f
61 Filter mode. Convert GIF on stdin to PNG on stdout, return error if
62 the GIF is multi-image.
63
64 -g
65 Write gamma=1/2.2 and sRGB chunks in the PNG.
66
67 -h
68 Generate PNG color-frequency histogram chunks into converted color
69 files.
70
71 -i
72 Force conversion to interlaced PNG files.
73
74 -n
75 Force conversion to non-interlaced PNG files.
76
77 -p
78 Display progress of PNG writing.
79
80 -r
81 Try to recover data from corrupted GIF files.
82
83 -s
84 Do not translate the GIF Software chunk to a PNG annotation.
85
86 -t
87 Change behavior of web-probe (-w) mode to accept GIFs with
88 transparency.
89
90 -v
91 Verbose mode; show summary line, -vv enables conversion-statistics
92 and debugging messages.
93
94 -w
95 Web-probe switch; list GIFs that do not have multiple images or
96 transparency to stdout. GIFs that fail this filter cause error
97 messages to stderr.
98
99 -O
100 Optimize; remove unused color-table entries. Normally these trigger
101 an error message and disable -d (but conversion is completed
102 anyway). Also, use zlib compression level 9 (best compression)
103 instead of the default level. The recovery algorithm enabled by -r
104 is as follows: Unused color table entries will not trigger an error
105 message as they normally do, but will still be preserved unless -O
106 is also on, in which case they will be discarded. Missing color
107 tables will be patched with a default that puts black at index 0,
108 white at index 1, and supplies red, green, blue, yellow, purple and
109 cyan as the remaining color values. Missing image pixels will be
110 set to 0. Unrecognized or corrupted extensions will be discarded.
111
113 Naively converting all your GIFs at one go with gif2png is not likely
114 to give you the results you want. The problem is not with PNG itself or
115 with gif2png, but with the poor-to-nonexistent support for PNG
116 transparency and animation in most browsers.
117
118 The web-probe switch is intended to be used with scripts for converting
119 web sites. All PNGs generated from the pathnames it returns will be
120 properly rendered in Netscape Navigator 4.04+, Internet Explorer
121 versions 4.0b1+, and all other current web browsers. Note: in future
122 releases of gif2png, the meaning of this switch may change to reflect
123 the capabilities of prevalent browsers.
124
126 Copies of the GIF89 specification are widely available on the Web;
127 search for "GRAPHICS INTERCHANGE FORMAT". The Graphics Interchange
128 Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm)
129 is a Service Mark property of CompuServe Incorporated. The GIF format
130 was formerly covered by a blocking patent on LZW compression, but it
131 expired in June 2003.
132
133 The PNG home site at <http://www.libpng.org/pub/png/> has very complete
134 information on the PNG standard, PNG libraries, and PNG tools.
135
137 web2png(1)
138
140 Code by Alexander Lehmann <alex@hal.rhein-main.de>, 1995.
141 Auto-interlace conversion and tRNS optimization by Greg Roelofs
142 <newt@pobox.com>, 1999. Man page, -O, -w, and production packaging by
143 Eric S. Raymond <esr@thyrsus.com>, 1999.
144
145
146
14720 September 1999 11/11/2009 GIF2PNG(1)