pnmquant(1) - man - phpman

Look up a command

 

Markdown Format | JSON API | MCP Server Tool | Cheat Sheet


TLDR: pnmquant (tldr-pages)

Quantize the colors in a PNM image into a smaller set.

  • Generate an image using only `n_colors` or less colors as close as possible to the input image
    pnmquant {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.pnm}}
pnmquant(1)                            General Commands Manual                           pnmquant(1)



NAME
       pnmquant - quantize the colors in a Netpbm image to a smaller set


SYNOPSIS
       pnmquant   [-center|-meancolor|-meanpixel]   [-floyd|-fs]   [-nofloyd|-nofs]  [-spreadbright‐‐
       ness|-spreadluminosity] ncolors [pnmfile]

       All options can be abbreviated to their shortest unique prefix.  You may use two hyphens  in‐
       stead  of one to designate an option.  You may use either white space or equals signs between
       an option name and its value.


DESCRIPTION
       Reads a PNM image as input.  Chooses ncolors colors to best represent the image, maps the ex‐
       isting colors to the new ones, and writes a PNM image as output.

       This program is simply a combination of pnmcolormap and pnmremap, where the colors of the in‐
       put are remapped using a color map which is generated from the colors  in  that  same  input.
       The  options  have  the same meaning as in those programs.  See their documentation to under‐
       stand pnmquant.

       It is much faster to call pnmcolormap and pnmremap directly than to run  pnmquant.   pnmquant
       is just a convenience.

       ppmquant  is  an older program which does the same thing as pnmquant, but on only PPM images.
       It is, however, faster than either pnmquant or ppmcolormap/pnmremap.


SEE ALSO
       pnmcolormap(1), pnmremap(1), ppmquantall(1), pnmdepth(1), ppmdither(1), ppmquant(1), pnm(5)


AUTHOR
       Written by Bryan Henderson



                                           20 January 2002                               pnmquant(1)

Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 16:31 @216.73.216.151 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!