home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ppmquant(1) USER COMMANDS ppmquant(1)
-
-
-
- NAME
- ppmquant - quantize the colors in a portable pixmap down to
- a specified number
-
- SYNOPSIS
- ppmquant [-floyd|-fs] _✓n_✓c_✓o_✓l_✓o_✓r_✓s [_✓p_✓p_✓m_✓f_✓i_✓l_✓e]
- ppmquant [-floyd|-fs] -map _✓m_✓a_✓p_✓f_✓i_✓l_✓e [_✓p_✓p_✓m_✓f_✓i_✓l_✓e]
-
- DESCRIPTION
- Reads a portable pixmap as input. Chooses _✓n_✓c_✓o_✓l_✓o_✓r_✓s colors to
- best represent the image, maps the existing colors to the
- new ones, and writes a portable pixmap as output.
-
- The quantization method is Heckbert's "median cut".
-
- Alternately, you can skip the color-choosing step by speci-
- fying your own set of colors with the -map flag. The _✓m_✓a_✓p_✓-
- _✓f_✓i_✓l_✓e is just a _✓p_✓p_✓m 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:
- 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
-
- The -floyd/-fs flag enables a Floyd-Steinberg error diffu-
- sion step. 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.
-
- All flags can be abbreviated to their shortest unique pre-
- fix.
-
- REFERENCES
- "Color Image Quantization for Frame Buffer Display" by Paul
- Heckbert, SIGGRAPH '82 Proceedings, page 297.
-
- SEE ALSO
- pnmdepth(1), ppmquantall(1), ppm(5)
-
- AUTHOR
- Copyright (C) 1989, 1991 by Jef Poskanzer.
-
-
-
-
- Sun Release 4.0 Last change: 12 January 1991 1
-
-
-
-