File: gif2png.1

package info (click to toggle)
gif2png 2.2.5-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 360 kB
  • ctags: 288
  • sloc: sh: 1,684; ansic: 1,557; python: 244; makefile: 61
file content (159 lines) | stat: -rw-r--r-- 6,405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.TH GIF2PNG 1 "20 September 1999"
.SH NAME
gif2png \- convert GIFs to PNGs
.SH SYNOPSIS
gif2png [-bdfghinprsvwO] [file[.gif]...]
.SH DESCRIPTION
The gif2png program converts files in the obsolescent and
patent-encumbered Graphic Interchange Format (GIF) to Portable Network
Graphics (PNG) format, an open W3C standard.

Normally gif2png converts each file named on the command line, leaving
the original in place.  If a name does not have a .gif extension, the
unmodified name will be tried first, followed by the name with .gif
appended.  For each file named `foo.gif', a foo.png will be created.

When a multi-image GIF file named foo.gif is converted, gif2png
creates multiple PNG files, each containing one frame; their names
will be foo.png, foo.p01, foo.p02 etc.

If no source files are specified and stdin is a terminal, gif2png lists
a usage summary and version information, then exits.

If no source files are specified, and stdin is a device or pipe, stdin
is converted to noname.png.  (The program can't be a normal
stdin-to-stdout filter because of the possibility that the input GIF
might have multiple images).

However, if filter mode is forced (with -f) stdin will be converted to
stdout, with gif2png returning an error code if the GIF is multi-image.

The program will preserve the information contained in a GIF file as
closely as possible, including GIF comment and application-data
extension blocks. All graphics data (pixels, RGB color tables) will be
converted without loss of information.  Transparency is also preserved.
There is one exception; GIF plain-text extensions are skipped.

The program automatically converts interlaced GIFs to interlaced PNGs.
It detects images in which all colors are gray (equal R, G, and B
values) and converts such images to PNG grayscale.  Other images are
converted to use the PNG palette type.  Duplicate color entries are
silently preserved.  Unused color-table entries cause an error message.

The action of the program can be modified with the following
command-line switches:

.TP 
.B -b {#}RRGGBB
Background.  Replace transparent pixels with given RGB value,
six hexadecimal digits interpreted as two hexits each of red,
green, and blue value.  The value may optionally be led with
a #, HTML-style.
.TP
.B -d
Delete source GIF files after successful conversion.
.TP 
.B -f
Filter mode.  Convert GIF on stdin to PNG on stdout, return error
if the GIF is multi-image.
.TP
.B -g 
Write gamma=1/2.2 and sRGB chunks in the PNG.
.TP
.B -h 
Generate PNG color-frequency histogram chunks into converted color files.
.TP
.B -i
Force conversion to interlaced PNG files.
.TP
.B -n
Force conversion to non-interlaced PNG files.
.TP
.B -p
Display progress of PNG writing.
.TP
.B -r
Try to recover data from corrupted GIF files.
.TP
.B -s
Do not translate the GIF Software chunk to a PNG annotation.
.TP
.B -v
Verbose mode; show summary line, -vv enables conversion-statistics and
debugging messages.
.TP
.B -w
Web-probe switch; list GIFs that do not have multiple images or
transparency to stdout.  GIFs that fail this filter cause error
messages to stderr.
.TP
.B -O
Optimize; remove unused color-table entries.  Normally these trigger
an error message and disable -d (but conversion is completed anyway).
Also, use zlib compression level 9 (best compression) instead of
the default level.

The recovery algorithm enabled by -r is as follows: Unused color table
entries will not trigger an error message as they normally do, but
will still be preserved unless -O is also on, in which case they will
be discarded. Missing color tables will be patched with a default that
puts black at index 0, white at index 1, and supplies red, green,
blue, yellow, purple and cyan as the remaining color values.  Missing
image pixels will be set to 0.  Unrecognized or corrupted extensions
will be discarded.

.SH PROBLEMS
Naively converting all your GIFs at one go with gif2png is not likely
to give you the results you want.  The problem is not with PNG itself
or with gif2png, but with the poor-to-nonexistent support for PNG
transparency and animation in most browsers.

The web-probe switch is intended to be used with scripts for
converting web sites.  All PNGs generated from the pathnames it
returns will be properly rendered in Netscape Navigator 4.04+,
Internet Explorer versions 4.0b1+, and all other current web browsers.
Note: in future releases of gif2png, the meaning of this switch may
change to reflect the capabilities of prevalent browsers.

.SH PATENT ISSUES
The GIF format is encumbered by a Unisys patent (see
<http://www.patents.ibm.com/details?pn=US04558302__>) for the
Lempel-Ziv-Welch compression algorithm.  Use of any GIF image
generator not licensed by Unisys can make you liable to lawsuit.
Unisys apparently refuses to issue licenses for use of LZW in
open-source programs, and in 1999 stated that its policy is to require
a $5000 fee from websites that carry GIF images made by unlicensed
software -- even nonprofit websites created and displayed with free
software.  See <http://corp2.unisys.com/LeadStory/lzw-license.html>
for details.

The patent probably does not cover LZW decompressors such as the one
gif2png uses; legal opinions are divided on this, there has been no court
test, and Unisys refuses to commit itself.  It is possible that
you may be liable if you distribute gif2png in a commercial program,
or distribute gif2png on a for-profit basis.   

For a history of the GIF patent controversy, see
<http://lpf.ai.mit.edu/Patents/Gif/Gif.html>.  To avoid legal
problems, it would be a good idea to convert all GIFs on your websites
and elsewhere to PNGs without delay.  See <http://burnallgifs.org/>
for discussion.

.SH STANDARDS AND SPECIFICATIONS
Copies of the GIF89 specification are widely available on the Web;
search for "GRAPHICS INTERCHANGE FORMAT".  The Graphics Interchange
Format(c) is the Copyright property of CompuServe
Incorporated. GIF(sm) is a Service Mark property of CompuServe
Incorporated.

The PNG home site at <http://www.cdrom.com/pub/png/> has very 
complete information on the PNG standard, PNG libraries, and PNG tools.

.SH SEE ALSO
web2png(1)

.SH AUTHORS
Code by Alexander Lehmann <alex@hal.rhein-main.de>, 1995.
Auto-interlace conversion and tRNS optimization by Greg Roelofs
<newt@pobox.com>, 1999.  Man page, -O, -w, and production packaging by
Eric S. Raymond <esr@thyrsus.com>, 1999.