1Ppmcolormask User Manual(0) Ppmcolormask User Manual(0)
2
3
4
6 ppmcolormask - produce mask of areas of a certain color in a PPM file
7
8
10 ppmcolormask -color=color_list [ppmfile]
11
12 ppmcolormask color [ppmfile]
13
14
16 ppmcolormask -color red testimg.ppm >redmask.pbm
17 pamcomp background.ppm testimg.ppm -alpha=redmask.pbm >test.ppm
18
19 ppmcolormask -color=red,pink,salmon testimg.ppm >reddishmask.pbm
20
21 ppmcolormask -color=bk:red,bk:orange,bk:yellow testimg.ppm >firemask.pbm
22
23
24
26 This program is part of Netpbm(1).
27
28 ppmcolormask reads a PPM file as input and produces a PBM (bitmap) file
29 as output. The output file is the same dimensions as the input file
30 and is black in all places where the input file is a color indicated by
31 the -color option, and white everywhere else.
32
33 The output of ppmcolormask is useful as a transparency mask input to
34 pamcomp. Note that you don't need ppmcolormask and pamcomp if you are
35 ultimately converting to PNG with pnmtopng because the -transparent
36 option on pnmtopng does the same thing.
37
38 ppmfile is the input file. If you don't specify ppmfile, the input is
39 from Standard Input.
40
41 The output goes to Standard Output.
42
43 In the obsolete alternative syntax, specifying the color names a single
44 exact color to be masked.
45
46 ppmchange does a similar thing: it modifies an image by changing colors
47 you specify to other colors you specify. The two programs give you
48 somewhat different means of specifying colors in the input image.
49
50 To make a mask of an image's background, without having to tell it what
51 color it is, use pambackground.
52
53
55 -color=color_list
56 This mandatory option specifies the colors that are to be masked
57 (where the image is one of these colors, the output mask will be
58 black).
59
60 Examples:
61
62
63
64 · -color=red
65
66 · -color=red,pink,salmon
67
68 · -color=rgb:80/80/ff
69
70 · -color=bk:red,bk:orange,bk:yellow
71
72
73 color_list is a list of colors separated by commas. Each color
74 is either an exact color name as described for the argument of
75 the ppm_parsecolor() library routine ⟨libppm.html#colorname⟩ or
76 one of the Berlin-Kay color names ⟨libppm.html#berlinkay⟩ . In
77 the latter case, all colors that are better described by that
78 Berlin-Kay color name than any other are in the mask set.
79
80 The algorithm ppmcolormask uses to determine to which colors a
81 Berlin-Kay color name applies is based on a Sugeno-type fuzzy
82 inference system developed by Kenan Kalajdzic in 2006. The
83 fuzzy model consists of partially linear membership functions
84 defined in the HSV color space. Although more complex algo‐
85 rithms for fuzzy color matching exist, this algorithm is inten‐
86 tionally simplified to achieve a satisfactory speed using rela‐
87 tively compact code.
88
89 This option was new in Netpbm 10.34 (June 2006). Before that,
90 you must use the color argument and cannot specify a Berlin-Kay
91 color.
92
93
94
95
97 pambackground(1), ppmchange(1), pgmtoppm(1), pamcomp(1), pbmmask(1),
98 pnmtopng(1), ppm(1)
99
101 This manual page was generated by the Netpbm tool 'makeman' from HTML
102 source. The master documentation is at
103
104 http://netpbm.sourceforge.net/doc/ppmcolormask.html
105
106netpbm documentation 1 May 2006 Ppmcolormask User Manual(0)