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

pgmtoppm — Colorize a PGM image. More information: <https://netpbm.sourceforge.net/doc/pgmtoppm.html>.

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

Problem

How to use the pgmtoppm command: Colorize a PGM image. More information: <https://netpbm.sourceforge.net/doc/pgmtoppm.html>.

Solution

pgmtoppm — Colorize a PGM image. More information: <https://netpbm.sourceforge.net/doc/pgmtoppm.html>.

Map all greyscale values of the input image to all colors between the two specified colors:
pgmtoppm {{[-b|-black]}} {{red}} {{[-w|-white]}} {{blue}} {{path/to/input.pgm}} > {{path/to/output.ppm}}


Map all greyscale values of the input image to colors according to the specified colormap:
pgmtoppm {{[-m|-map]}} {{path/to/colormap.ppm}} {{path/to/input.pgm}} > {{path/to/output.ppm}}

Code Snippets

Map all greyscale values of the input image to all colors between the two specified colors

pgmtoppm {{[-b|-black]}} {{red}} {{[-w|-white]}} {{blue}} {{path/to/input.pgm}} > {{path/to/output.ppm}}

Map all greyscale values of the input image to colors according to the specified colormap

pgmtoppm {{[-m|-map]}} {{path/to/colormap.ppm}} {{path/to/input.pgm}} > {{path/to/output.ppm}}

Context

tldr-pages: common/pgmtoppm

Revisions (0)

No revisions yet.