.TL Ppmcolormask User Manual .SH 1 ppmcolormask .LP Updated: 1 May 2006 .br Table Of Contents .SH 2 NAME .LP ppmcolormask - produce mask of areas of a certain color in a PPM file .SH 2 SYNOPSIS .LP \fBppmcolormask\fR \fB-color=\fR\fIcolor_list\fR [\fIppmfile\fR] .LP Obsolete: .LP \fBppmcolormask\fR \fIcolor\fR [\fIppmfile\fR] .SH 2 EXAMPLES .LP .DS L 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 .DE .SH 2 DESCRIPTION .LP .LP This program is part of Netpbm. .LP \fBppmcolormask\fR 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\fR option, and white everywhere else. .LP The output of \fBppmcolormask\fR is useful as an alpha mask input to \fBpamcomp\fR. Note that you can generate such an alpha mask automatically as you convert to PNG format with \fBpnmtopng\fR. Use its \fB-transparent\fR option. .LP \fIppmfile\fR is the input file. If you don't specify \fIppmfile\fR, the input is from Standard Input. .LP The output goes to Standard Output. .LP In the obsolete alternative syntax, specifying the \fIcolor\fR names a single exact color to be masked. .LP \fBppmchange\fR 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. .SH 2 OPTIONS .LP .RS .IP "\fB-color=\fR\fIcolor_list\fR" 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). .LP Examples: .IP \(bu \fB-color=red\fR .IP \(bu \fB-color=red,pink,salmon\fR .IP \(bu \fB-color=rgb:80/80/ff\fR .IP \(bu \fB-color=bk:red,bk:orange,bk:yellow\fR .LP .LP \fIcolor_list\fR is a list of colors separated by commas. Each color is either an exact color name as described for the argument of the \fBppm_parsecolor()\fR library routine or one of the Berlin-Kay color names. In the latter case, all colors that are better described by that Berlin-Kay color name than any other are in the mask set. .LP The algorithm \fBppmcolormask\fR uses to determine to which colors a Berlin-Kay color name applies is based on a Sugeno-type fuzzy inference system developed by Kenan Kalajdzic 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. .LP This option was new in Netpbm 10.34 (June 2006). Before that, you must use the \fIcolor\fR argument and cannot specify a Berlin-Kay color. .RE .SH 2 SEE ALSO .LP \fBppmchange\fR, \fBpgmtoppm\fR, \fBpamcomp\fR, \fBpbmmask\fR, \fBppm\fR .br \l'5i' .SH 2 Table Of Contents .LP .IP \(bu SYNOPSIS .IP \(bu EXAMPLES .IP \(bu DESCRIPTION .IP \(bu SEE ALSO .IP \(bu AUTHOR .LP