Ppmcolormask User Manual(1) General Commands Manual Ppmcolormask User Manual(1)

ppmcolormask - produce mask of areas of a certain color in a PPM file

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(1).

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 indicated by the -color option, and white everywhere else.

The output of ppmcolormask is useful as a transparency mask input to pamcomp. Note that you don't need ppmcolormask and pamcomp if you are ultimately converting to PNG with pnmtopng because the -transparent option on pnmtopng does the same thing.

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 single exact color to be masked.

ppmchange does a similar thing: it modifies an image by changing colors 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.

In addition to the options common to all programs based on libnetpbm (most notably -quiet, see
Common Options
), ppmcolormask recognizes the following command line option:

This mandatory option specifies the colors that are to be masked (where the image is one of these colors, the output mask will be black).

Examples:

pamfind(1), pambackground(1), ppmchange(1), pgmtoppm(1), pamcomp(1), pbmmask(1), pnmtopng(1), ppm(1)

This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at

http://netpbm.sourceforge.net/doc/ppmcolormask.html
01 May 2006 netpbm documentation