1GIF2PNG(1)                         Graphics                         GIF2PNG(1)
2
3
4

NAME

6       gif2png - convert GIFs to PNGs
7

SYNOPSIS

9       gif2png [-bdfghimnprsvwO] [file.[gif]...]
10

DESCRIPTION

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       -m
65           Preserve file modification time. The PNG output gets the mod time
66           of the input file, not the time it was converted.
67
68       -g
69           Write gamma=1/2.2 and sRGB chunks in the PNG.
70
71       -h
72           Generate PNG color-frequency histogram chunks into converted color
73           files.
74
75       -i
76           Force conversion to interlaced PNG files.
77
78       -n
79           Force conversion to non-interlaced PNG files.
80
81       -p
82           Display progress of PNG writing.
83
84       -r
85           Try to recover data from corrupted GIF files.
86
87           The recovery algorithm enabled by -r is as follows: Unused color
88           table entries will not trigger an error message as they normally
89           do, but will still be preserved unless -O is also on, in which case
90           they will be discarded. Missing color tables will be patched with a
91           default that puts black at index 0, white at index 1, and supplies
92           red, green, blue, yellow, purple and cyan as the remaining color
93           values. Missing image pixels will be set to 0. Unrecognized or
94           corrupted extensions will be discarded.
95
96       -s
97           Do not translate the GIF Software chunk to a PNG annotation.
98
99       -v
100           Verbose mode; show summary line, -vv enables conversion-statistics
101           and debugging messages.
102
103       -w
104           Web-probe switch; list GIFs that do not have multiple images to
105           stdout. GIFs that fail this filter cause error messages to stderr.
106
107        -O
108           Optimize; remove unused color-table entries. Normally these trigger
109           an error message and disable -d (but conversion is completed
110           anyway). Also, use zlib compression level 9 (best compression)
111           instead of the default level.
112

PROBLEMS

114       Naively converting all your GIFs at one go with gif2png is not likely
115       to give you the results you want. Animated GIFs cannot be translated to
116       PNG, which is a single-image format.
117
118       The web-probe switch is intended to be used with scripts for converting
119       web sites. In versions of this tool up to 2.5.2 it filtered out GIFs
120       with transparency as well as GIFs with animations, but support for PNG
121       transparency has been universal in browsers since about 2006.
122

STANDARDS AND SPECIFICATIONS

124       Copies of the GIF89 specification are widely available on the Web;
125       search for "GRAPHICS INTERCHANGE FORMAT". The Graphics Interchange
126       Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm)
127       is a Service Mark property of CompuServe Incorporated. The GIF format
128       was formerly covered by a blocking patent on LZW compression, but it
129       expired in June 2003.
130
131       The PNG home site at <http://www.libpng.org/pub/png/> has very complete
132       information on the PNG standard, PNG libraries, and PNG tools.
133

SEE ALSO

135       web2png(1)
136

AUTHORS

138       Code by Alexander Lehmann <alex@hal.rhein-main.de>, 1995.
139       Auto-interlace conversion and tRNS optimization by Greg Roelofs
140       <newt@pobox.com>, 1999. Man page, -O, -w, and production packaging by
141       Eric S. Raymond <esr@thyrsus.com>, 1999. -m option by Steve Ward, 2012.
142
143
144
145gif2png                           07/14/2015                        GIF2PNG(1)
Impressum