HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pnmcolormap — Create quantization color map for a PNM image. More information: <https://netpbm.sourceforge.net/doc

Submitted by: @import:tldr-pages··
0
Viewed 0 times
createcommandpnmcolormapquantizationcolorclimapfor

Problem

How to use the pnmcolormap command: Create quantization color map for a PNM image. More information: <https://netpbm.sourceforge.net/doc/pnmcolormap.html>.

Solution

pnmcolormap — Create quantization color map for a PNM image. More information: <https://netpbm.sourceforge.net/doc/pnmcolormap.html>.

Generate an image using only n_colors or less colors as close as possible to the input image:
pnmcolormap {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}


Use the splitspread strategy for determining the output colors, possibly producing a better result for images with small details:
pnmcolormap {{[-splits|-splitspread]}} {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}


Sort the resulting colormap, which is useful for comparing colormaps:
pnmcolormap {{[-so|-sort]}} {{path/to/input.pnm}} > {{path/to/output.ppm}}

Code Snippets

Generate an image using only `n_colors` or less colors as close as possible to the input image

pnmcolormap {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}

Use the splitspread strategy for determining the output colors, possibly producing a better result for images with small details

pnmcolormap {{[-splits|-splitspread]}} {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}

Sort the resulting colormap, which is useful for comparing colormaps

pnmcolormap {{[-so|-sort]}} {{path/to/input.pnm}} > {{path/to/output.ppm}}

Context

tldr-pages: common/pnmcolormap

Revisions (0)

No revisions yet.