\ .\" This man page was generated by the Netpbm tool 'makeman' from HTML source. .\" Do not hand-hack it! If you have bug fixes or improvements, please find .\" the corresponding HTML page on the Netpbm website, generate a patch .\" against that, and send it to the Netpbm maintainer. .TH "Ppmcolormask User Manual" 1 "01 May 2006" "netpbm documentation" .SH NAME ppmcolormask - produce mask of areas of a certain color in a PPM file .UN synopsis .SH SYNOPSIS \fBppmcolormask\fP \fB-color=\fP\fIcolor_list\fP [\fIppmfile\fP] .PP \fBppmcolormask\fP \fIcolor\fP [\fIppmfile\fP] .UN examples .SH EXAMPLES .nf \f(CW 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 \fP .fi .UN description .SH DESCRIPTION .PP This program is part of .BR "Netpbm" (1)\c \&. .PP \fBppmcolormask\fP 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 \fB-color\fP option, and white everywhere else. .PP The output of \fBppmcolormask\fP is useful as a transparency mask input to \fBpamcomp\fP. Note that you don't need \fBppmcolormask\fP and \fBpamcomp\fP if you are ultimately converting to PNG with \fBpnmtopng\fP because the \fB-transparent\fP option on \fBpnmtopng\fP does the same thing. .PP \fIppmfile\fP is the input file. If you don't specify \fIppmfile\fP, the input is from Standard Input. .PP The output goes to Standard Output. .PP In the obsolete alternative syntax, specifying the \fIcolor\fP names a single exact color to be masked. .PP \fBppmchange\fP 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. .PP To make a mask of an image's background, without having to tell it what color it is, use \fBpambackground\fP. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBppmcolormask\fP recognizes the following command line option: .TP \fB-color=\fP\fIcolor_list\fP 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). .sp Examples: .IP \(bu \fB-color=red\fP .IP \(bu \fB-color=red,pink,salmon\fP .IP \(bu \fB-color=rgb:80/80/ff\fP .IP \(bu \fB-color=bk:red,bk:orange,bk:yellow\fP .sp \fIcolor_list\fP is a list of colors separated by commas. Each color is either an exact color name as described for the .UR libnetpbm_image.html#colorname argument of the \fBpnm_parsecolor()\fP library routine .UE \& or one of the .UR libppm.html#berlinkay Berlin-Kay color names .UE \&. In the latter case, all colors that are better described by that Berlin-Kay color name than any other are in the mask set. .sp The algorithm \fBppmcolormask\fP uses to determine to which colors a Berlin-Kay color name applies is based on a Sugeno-type fuzzy inference system developed by \fIKenan Kalajdzic\fP in 2006. The fuzzy model consists of partially linear membership functions defined in the HSV color space. Although more complex algorithms for fuzzy color matching exist, this algorithm is intentionally simplified to achieve a satisfactory speed using relatively compact code. .sp This option was new in Netpbm 10.34 (June 2006). Before that, you must use the \fIcolor\fP argument and cannot specify a Berlin-Kay color. .UN seealso .SH SEE ALSO .BR "pamfind" (1)\c \&, .BR "pambackground" (1)\c \&, .BR "ppmchange" (1)\c \&, .BR "pgmtoppm" (1)\c \&, .BR "pamcomp" (1)\c \&, .BR "pbmmask" (1)\c \&, .BR "pnmtopng" (1)\c \&, .BR "ppm" (1)\c \& .SH DOCUMENT SOURCE This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at .IP .B http://netpbm.sourceforge.net/doc/ppmcolormask.html .PP