333 lines
7.3 KiB
HTML
333 lines
7.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of ppmtogif</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>ppmtogif</H1>
|
|
Section: User Commands (1)<BR>Updated: 20 May 2000<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="ixAAB"></A>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ppmtogif - convert a portable pixmap into a GIF file
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>ppmtogif</B>
|
|
|
|
[<B>-interlace</B>]
|
|
|
|
[<B>-sort</B>]
|
|
|
|
[<B>-map</B>
|
|
|
|
<I>mapfile</I>]
|
|
|
|
<BR>
|
|
|
|
[<B>-transparent</B>
|
|
|
|
[<B>=</B>]<B></B><I>color</I>]
|
|
|
|
[<B>-alpha</B>
|
|
|
|
<I>pgmfile</I>]
|
|
|
|
[<B>-comment</B>
|
|
|
|
<I>text</I>]
|
|
|
|
[<B>-nolzw</B>]
|
|
|
|
<BR>
|
|
|
|
[<I>ppmfile</I>]
|
|
|
|
<P>
|
|
|
|
All options can be abbreviated to their shortest unique prefix. You
|
|
may use two hyphens instead of one to designate an option. You may
|
|
use either white space or equals signs between an option name and its
|
|
value.
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Reads a portable pixmap as input. Produces a GIF file as output.
|
|
<P>
|
|
This program creates only individual GIF images. To combine multiple GIF
|
|
images into an animated GIF, use
|
|
<B>gifsicle</B>
|
|
|
|
(not part of the Netpbm package).
|
|
<P>
|
|
<B>ppmtogif</B>
|
|
|
|
creates either an original GIF87 format GIF file or the newer GIF89 format.
|
|
It creates GIF89 when you request features that were new with GIF89, to wit
|
|
the
|
|
<B>-transparent</B>
|
|
|
|
or
|
|
<B>-comment</B>
|
|
|
|
options. Otherwise, it creates GIF87. Really old GIF readers conceivably
|
|
could not recognize GIF89.
|
|
<P>
|
|
<A NAME="ixAAC"></A>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-interlace</B>
|
|
|
|
<DD>
|
|
Produce an interlaced GIF file.
|
|
<DT id="2"><B>-sort</B>
|
|
|
|
<DD>
|
|
Produces a GIF file with a sorted color map.
|
|
<DT id="3"><B>-map </B>
|
|
|
|
<DD>
|
|
<I>mapfile</I>
|
|
|
|
<P>
|
|
Uses the colors found in the
|
|
<I>mapfile</I>
|
|
|
|
to create the colormap in the GIF file, instead of the colors from
|
|
<I>ppmfile.</I>
|
|
|
|
The
|
|
<I>mapfile</I>
|
|
|
|
can be any
|
|
<I>ppm</I>
|
|
|
|
file; all that matters is the colors in it. If the colors in
|
|
<I>ppmfile</I>
|
|
|
|
do not match those in
|
|
<I>mapfile</I>
|
|
|
|
, they are matched to a "best match." A (much) better result can be obtained by
|
|
using the following filter in advance:
|
|
<P>
|
|
<I>ppmquant</I>
|
|
|
|
-floyd -map
|
|
<I>mapfile</I>
|
|
|
|
<DT id="4"><B>-transparent </B><I>color</I>
|
|
|
|
<DD>
|
|
<B>ppmtogif</B>
|
|
|
|
marks the specified color as transparent in the GIF image.
|
|
<P>
|
|
If you don't specify
|
|
<B>-transparent</B>,
|
|
|
|
<B>ppmtogif</B>
|
|
|
|
does not mark any color transparent (except as indicated by the
|
|
<B>-alpha</B>
|
|
|
|
option).
|
|
<P>
|
|
You specify the color as in
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ppmmake">ppmmake</A></B>(1).<B>E.g.</B>
|
|
|
|
<B>red</B>
|
|
|
|
or
|
|
<B>rgb:ff/00/0d</B>.
|
|
|
|
If the color you specify is not present in the image,
|
|
<B>ppmtogif</B>
|
|
|
|
selects instead the color in the image that is closest to the one you
|
|
specify. Closeness is measured as a cartesian distance between colors
|
|
in RGB space. If multiple colors are equidistant,
|
|
<B>ppmtogif</B>
|
|
|
|
chooses one of them arbitrarily.
|
|
<P>
|
|
However, if you prefix your color specification with "=", e.g.
|
|
<P>
|
|
<B>-transparent==red</B>
|
|
|
|
<P>
|
|
Only the exact color you specify will be transparent. If that color does
|
|
not appear in the image, there will be no transparency.
|
|
<B>ppmtogif</B>
|
|
|
|
issues an information message when this is the case.
|
|
<P>
|
|
You cannot specify both
|
|
<B>-transparent</B>
|
|
|
|
and
|
|
<B>-alpha</B>.
|
|
|
|
<P>
|
|
<DT id="5"><B>-alpha= </B><I>pgmfile</I>
|
|
|
|
<DD>
|
|
This option names a PGM file that contains an alpha mask for the image.
|
|
<B>ppmtogif</B>
|
|
|
|
Creates fully transparent pixels wherever the alpha
|
|
mask indicates transparency greater than 50%. The color of those pixels
|
|
is that specified by the
|
|
<B>-alphacolor</B>
|
|
|
|
option, or black by default.
|
|
<P>
|
|
To do this,
|
|
<B>ppmtogif</B>
|
|
|
|
creates an entry in the GIF colormap in addition to the entries for colors
|
|
that are actually in the image. It marks that colormap entry as transparent
|
|
and uses that colormap index in the output image to create a transparent
|
|
pixel.
|
|
<P>
|
|
The alpha image must be the same dimensions as the input image, but may
|
|
have any maxval. White means opaque and black means transparent.
|
|
<P>
|
|
You cannot specify both
|
|
<B>-transparent</B>
|
|
|
|
and
|
|
<B>-alpha</B>.
|
|
|
|
<P>
|
|
<DT id="6"><B>-alphacolor</B>
|
|
|
|
<DD>
|
|
See
|
|
<B>-alpha</B>.
|
|
|
|
<P>
|
|
<DT id="7"><B>-comment </B><I>text</I>
|
|
|
|
<DD>
|
|
Include a comment in the GIF output with comment text
|
|
<I>text</I>.
|
|
|
|
Without this option, there are no comments in the output.
|
|
<P>
|
|
<DT id="8"><B>-nolzw </B>
|
|
|
|
<DD>
|
|
This option causes the GIF output, and thus
|
|
<B>ppmtogif</B>,
|
|
|
|
not to use LZW (Lempel-Ziv) compression. As a result, the image file is
|
|
larger and no royalties are owed to the holder of the patent on LZW.
|
|
See the section LICENSE below.
|
|
<P>
|
|
LZW is a method for combining the information from multiple pixels into a
|
|
single GIF code. With the
|
|
<B>-nolzw</B>
|
|
|
|
option,
|
|
<B>ppmtogif</B>
|
|
|
|
creates one GIF code per pixel, so it is not doing any compression and not
|
|
using LZW. However, any GIF decoder, whether it uses an LZW decompressor
|
|
or not, will correctly decode this uncompressed format. An LZW decompressor
|
|
would see this as a particular case of LZW compression.
|
|
<P>
|
|
Note that if someone uses an LZW decompressor such as the one in
|
|
<B>ppmtogif</B>
|
|
|
|
or pretty much any graphics display program to process the output of
|
|
<B>ppmtogif -nolzw </B>
|
|
|
|
he is then using the LZW patent. But the patent holder has expressed
|
|
far less interest in enforcing the patent on decoding than on encoding.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+giftopnm">giftopnm</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ppmquant">ppmquant</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+pngtopnm">pngtopnm</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+gifsicle">gifsicle</A></B>(1)
|
|
|
|
<<A HREF="http://www.lcdf.org/gifsicle">http://www.lcdf.org/gifsicle</A>>,
|
|
<B><A HREF="/cgi-bin/man/man2html?5+ppm">ppm</A></B>(5).
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Based on GIFENCOD by David Rowley <<A HREF="mailto:mgardi@watdcsu.waterloo.edu">mgardi@watdcsu.waterloo.edu</A>>.
|
|
Lempel-Ziv compression based on "compress".
|
|
<P>
|
|
The non-LZW format is generated by code based on
|
|
<B>djpeg</B>
|
|
|
|
by the Independent Jpeg Group.
|
|
<P>
|
|
Copyright (C) 1989 by Jef Poskanzer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>LICENSE</H2>
|
|
|
|
If you use
|
|
<B>ppmtogif</B>
|
|
|
|
without the
|
|
<B>-nolzw</B>
|
|
|
|
option, you are using a patent on the LZW compression method which is
|
|
owned by Unisys, and in all probability you do not have a license from
|
|
Unisys to do so. Unisys typically asks $5000 for a license for
|
|
trivial use of the patent. Unisys has never enforced the patent
|
|
against trivial users. The patent expires in 2003.
|
|
<P>
|
|
Rumor has it that IBM also owns a patent covering
|
|
<B>ppmtogif</B>.
|
|
|
|
<P>
|
|
A replacement for the GIF format that does not require any patents to use
|
|
is the PNG format.
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="10"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="11"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="12"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="13"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="14"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="15"><A HREF="#lbAH">LICENSE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:25 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|