PPMQUANT



		

NAME

      ppmquant - quantize the colors in a portable pixmap down to a
      specified number

SYNOPSIS

      ppmquant [-floyd|-fs] <ncolors> [ppmfile]

DESCRIPTION

      Reads a portable pixmap as input.  Chooses <ncolors> 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".
      The -floyd flag adds a Floyd-Steinberg error diffusion step.  This may
      give better results on images where the unmodified quantization has
      banding or other artifacts.  It takes maybe 20% more CPU time.
      All flags can be abbreviated to their shortest unique prefix.

DEMONSTRATION

      Let a.ppm be a portable pixmap.
      The following command will quantize its number of color down to 16:
	ppmmerge ppmquant 16 a.ppm > aquant.ppm

BEFORE

AFTER

32 colors + Floyd-Steinberg error diffusion:

32 colors:

16 colors + Floyd-Steinberg error diffusion:

16 colors:


		

REFERENCES

      "Color Image Quantization for Frame Buffer Display" by Paul Heckbert,
      SIGGRAPH '82 Proceedings, page 297.

SEE ALSO

      ppmcscale(1), ppm(5)

AUTHOR

      Copyright (C) 1989 by Jef Poskanzer.
      Permission to use, copy, modify, and distribute this software and its
      documentation for any purpose and without fee is hereby granted,
      provided that the above copyright notice appear in all copies and that
      both that copyright notice and this permission notice appear in
      supporting documentation.  This software is provided "as is" without
      express or implied warranty.