about summary refs log tree commit diff
path: root/giftopnm.html
blob: 3a3d2f2e2fac97709143af4ce9b0d7fb88b6d12b (plain) (blame)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Giftopnm User Manual</TITLE></HEAD>
<BODY>
<H1>giftopnm</H1>
Updated: 6 August 2006
<BR>

<A HREF="#index">Table Of Contents</A>

giftopnm - convert a GIF file into a PNM image

<H2 id="synopsis">SYNOPSIS</H2>

<B>giftopnm</B>
[<B>--alphaout=</B>{<I>alpha-filename</I>,<B>-</B>}]
[<B>-verbose</B>]
[<B>-comments</B>]
[<B>-image=</B>{<I>N</I>,<B>all</b>}]
[<B>-quitearly</B>]
[<I>GIFfile</I>]

<p>Minimum unique abbreviation of option is acceptable.  You may use double
hyphens instead of single hyphen to denote options.  You may use white
space in place of the equals sign to separate an option name from its value.

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p>This is a graphics format converter from the GIF format to the PNM 
(i.e. PBM, PGM, or PPM) format.

<P>If the image contains only black and maximally bright white, the
output is PBM.  If the image contains more than those two colors, but
only grays, the output is PGM.  If the image contains other colors,
the output is PPM.

<P> A GIF image contains rectangular pixels.  They all have the same
aspect ratio, but may not be square (it's actually quite unusual for
them not to be square, but it could happen).  The pixels of a Netpbm
image are always square.  Because of the engineering complexity to do
otherwise, <B>giftopnm</B> converts a GIF image to a Netpbm image
pixel-for-pixel.  This means if the GIF pixels are not square, the
Netpbm output image has the wrong aspect ratio.  In this case,
<B>giftopnm</B> issues an informational message telling you to run
<B>pamscale</B> to correct the output.

<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<DL COMPACT>
<DT><B>--alphaout=</B><I>alpha-filename</I>

<DD><B>giftopnm </B> creates a PGM (portable graymap) file containing
the alpha channel values in the input image.  If the input image
doesn't contain an alpha channel, the <I>alpha-filename</I> file
contains all zero (transparent) alpha values.  If you don't specify
<B>--alphaout</B>, <B>giftopnm</B> does not generate an alpha file,
and if the input image has an alpha channel, <B>giftopnm</B> simply
discards it.

<P>If you specify <B>-</B> as the filename, <B>giftopnm</B> writes the
alpha output to Standard Output and discards the image.

<P>See <B><A HREF="pamcomp.html">pamcomp</A></B> for one way to use
the alpha output file.  

<DT><B>-verbose</B>

<DD>Produce verbose output about the GIF file input.

<DT><B>-comments</B>

<DD>
Only output GIF89 comment fields.

<DT><B>-image=</B>{<I>N</I>,<B>all</b>}

<DD>
This option identifies which image from the GIF stream you want.  
You can select either one image or all the images.  Select al the 
images with <b>all</b>.  Select one image by specifying its sequence
number in the stream: <b>1</b>, <b>2</b>, <b>3</b>, etc.

<p>The default is just Image 1.

<p>A GIF stream normally contains only one image, so you don't need
this option.  But some streams, including animated GIFs, have multiple
images.

<p>When you select multiple GIF images, the output is a PNM stream with
multiple images.

<p>If you specify a single image, <b>giftopnm</b> must read and
partially validate the images before that in the stream.  It may or may
not do the same for the images after it; see <b>-quitearly</b>.

<p>The <b>all</b> value was added in Netpbm 10.16 (June 2003).  Earlier
<b>giftopnm</b> can extract only one image.

<dt><b>-quitearly</b>

<dd>This options makes <b>giftopnm</b> stop reading its input file as soon
as it has converted and output the images from the input that you requested.
By default, <b>giftopnm</b> reads until the end of the GIF stream, ignoring
any data after the images you requested.

<p>Two reasons <em>not</em> to use this option:
<ul>
<li>The input file is a pipe and the process that is filling that pipe
expects the pipe to take the entire stream and will fail or get stuck
if it doesn't.

<li>You want to validate the entire GIF stream.

</ul>

<p>Two reasons to use this option:

<ul>
<li>It saves the time and other resources to read the end of the stream.
<li>There are errors in the end of the stream that make <b>giftopnm</b> fail.
</ul>

<p>This option has no effect if you also specify <b>-image=all</b>

<P>This option was new in Netpbm 10.35 (August 2006).  Before that, 
<b>giftopnm</b> always reads the entire stream.
     
</DL>

<H2 id="restrictions">RESTRICTIONS</H2>

<p>This does not correctly handle the Plain Text Extension of the
GIF89 standard, since I did not have any example input files
containing them.

<H2 id="seealso">SEE ALSO</H2>

<B><A HREF="pamtogif.html">pamtogif</A></B>,
<B><A HREF="ppmcolormask.html">ppmcolormask</A></B>,
<B><A HREF="pamcomp.html">pamcomp</A></B>,
&lt;<A
HREF="http://www.lcdf.org/gifsicle">http://www.lcdf.org/gifsicle</A>&gt;,
<B><A HREF="ppm.html">ppm</A></B>.

<H2 id="author">AUTHOR</H2>

<p>Copyright (c) 1993 by David Koblas (<A
HREF="mailto:koblas@netcom.com">koblas@netcom.com</A>)

<H2 id="license">LICENSE</H2>

<p>As a historical note, for a long time if you used <B>giftopnm</B>,
you were using a patent on the LZW compression method which was owned
by Unisys, and in all probability you did not have a license from
Unisys to do so.  Unisys typically asked $5000 for a license for
trivial use of the patent.  Unisys never enforced the patent against
trivial users, and made statements that it is much less concerned
about people using the patent for decompression (which is what
<B>giftopnm</B> does than for compression.  The patent expired in
2003.

<P>Rumor has it that IBM also owns a patent covering <B>giftopnm</B>.

<P>A replacement for the GIF format that has never required any patent
license to use is the PNG format.


<HR>
<A NAME="index">&nbsp;</A><H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#restrictions">RESTRICTIONS</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#author">AUTHOR</A>
<LI><A HREF="#license">LICENSE</A>
</UL>
</BODY>
</HTML>