ppmcolormask -color=color_list [ppmfile]

ppmcolormask color [ppmfile]


ppmcolormask -color red testimg.ppm >redmask.pbm
pamcomp background.ppm testimg.ppm -alpha=redmask.pbm >test.ppm

ppmcolormask -color=red,pink,salmon testimg.ppm >reddishmask.pbm

ppmcolormask -color=bk:red,bk:orange,bk:yellow testimg.ppm >firemask.pbm

This program is part of Netpbm.

ppmcolormask reads a PPM file as input and produces a PBM (bitmap)
file as output. The output file is the same dimensions as the input
file and is black in all places where the input file is a color indi-
cated by the -color option, and white everywhere else.

The output of ppmcolormask is useful as an alpha mask input to pam-
comp. Note that you can generate such an alpha mask automatically as
you convert to PNG format with pnmtopng.Useits-transparent option.

ppmfile is the input file. If you don't specify ppmfile, the input is
from Standard Input.

The output goes to Standard Output.

In the obsolete alternative syntax, specifying the color names a sin-
gle exact color to be masked.

ppmchange does a similar thing: it modifies an image by changing col-
ors you specify to other colors you specify. The two programs give
you somewhat different means of specifying colors in the input image.

To make a mask of an image's background, without having to tell it
what color it is, use pambackground.


? -color=red

? -color=red,pink,salmon

? -color=rgb:80/80/ff

? -color=bk:red,bk:orange,bk:yellow

pambackground, ppmchange, pgmtoppm, pamcomp, pbmmask,