man-pages/man1/ppmquant.1.html
2021-03-31 01:06:50 +01:00

172 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ppmquant</TITLE>
</HEAD><BODY>
<H1>ppmquant</H1>
Section: User Commands (1)<BR>Updated: 12 January 1991<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">&nbsp;</A>
<H2>NAME</H2>
ppmquant - quantize the colors in a portable pixmap down to a specified number
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>ppmquant</B>
[<B>-floyd</B>|<B>-fs</B>]
<I>ncolors</I>
[<I>ppmfile</I>]
<BR>
<B>ppmquant</B>
[<B>-floyd</B>|<B>-fs</B>]
[<B>-nofloyd</B>|<B>-nofs</B>]
<B>-mapfile</B>
<I>mapfile</I>
[<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">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>pnmquant </B>
is a newer, more general program that is backward compatible with
<B>ppmquant</B>.
<B>ppmquant</B>
may be faster, though.
<P>
Reads a PPM image as input. Chooses
<I>ncolors</I>
colors to best represent the image, maps the existing colors
to the new ones, and writes a PPM image as output.
<A NAME="ixAAC"></A>
<P>
The quantization method is Heckbert's &quot;median cut&quot;.
<A NAME="ixAAD"></A>
<P>
Alternately, you can skip the color-choosing step by
specifying your own set of colors with the
<B>-mapfile</B>
option. The
<I>mapfile</I>
is just a
<I>ppm</I>
file; it can be any shape, all that matters is the colors in it.
For instance, to quantize down to the 8-color IBM TTL color set, you
might use:
<PRE>
P3
8 1
255
0 0 0
255 0 0
0 255 0
0 0 255
255 255 0
255 0 255
0 255 255
255 255 255
</PRE>
If you want to quantize one image to use the colors in another one,
just use the second one as the mapfile. You don't have to reduce it
down to only one pixel of each color, just use it as is.
<P>
If you use a mapfile, the output image has the same maxval as the
mapfile. Otherwise, the output maxval is the same as the input
maxval, or less in some cases where the quantization process reduces
the necessary resolution.
<P>
<P>
The
<B>-floyd</B>/<B>-fs</B>
option enables a Floyd-Steinberg error diffusion step.
<A NAME="ixAAE"></A>
<A NAME="ixAAF"></A>
Floyd-Steinberg gives vastly better results on images where the unmodified
quantization has banding or other artifacts, especially when going to a
small number of colors such as the above IBM set.
However, it does take substantially more CPU time, so the default is off.
<P>
<B>-nofloyd</B>/<B>-nofs</B>
means not to use the Floyd-Steinberg error diffusion. This is the default.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>REFERENCES</H2>
&quot;Color Image Quantization for Frame Buffer Display&quot; by Paul Heckbert,
SIGGRAPH '82 Proceedings, page 297.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+pnmquant">pnmquant</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+ppmquantall">ppmquantall</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+pnmdepth">pnmdepth</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+ppmdither">ppmdither</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+ppm">ppm</A></B>(5)
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Copyright (C) 1989, 1991 by Jef Poskanzer.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">REFERENCES</A><DD>
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="6"><A HREF="#lbAG">AUTHOR</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>