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
25
27 This program is part of Netpbm(1).
28
29 ppmcolormask reads a PPM file as input and produces a PBM (bitmap) file
30 as output. The output file is the same dimensions as the input file
31 and is black in all places where the input file is a color indicated by
32 the -color option, and white everywhere else.
33
34 The output of ppmcolormask is useful as a transparency mask input to
35 pamcomp. Note that you don't need ppmcolormask and pamcomp if you are
36 ultimately converting to PNG with pnmtopng because the -transparent op‐
37 tion on pnmtopng does the same thing.
38
39 ppmfile is the input file. If you don't specify ppmfile, the input is
40 from Standard Input.
41
42 The output goes to Standard Output.
43
44 In the obsolete alternative syntax, specifying the color names a single
45 exact color to be masked.
46
47 ppmchange does a similar thing: it modifies an image by changing colors
48 you specify to other colors you specify. The two programs give you
49 somewhat different means of specifying colors in the input image.
50
51 To make a mask of an image's background, without having to tell it what
52 color it is, use pambackground.
53
54
56 In addition to the options common to all programs based on libnetpbm
57 (most notably -quiet, see
58 Common Options ⟨index.html#commonoptions⟩ ), ppmcolormask recognizes
59 the following command line option:
60
61
62
63 -color=color_list
64 This mandatory option specifies the colors that are to be masked
65 (where the image is one of these colors, the output mask will be
66 black).
67
68 Examples:
69
70
71
72 • -color=red
73
74 • -color=red,pink,salmon
75
76 • -color=rgb:80/80/ff
77
78 • -color=bk:red,bk:orange,bk:yellow
79
80
81 color_list is a list of colors separated by commas. Each color
82 is either an exact color name as described for the argument of
83 the pnm_parsecolor() library routine
84 ⟨libnetpbm_image.html#colorname⟩ or one of the Berlin-Kay color
85 names ⟨libppm.html#berlinkay⟩ . In the latter case, all colors
86 that are better described by that Berlin-Kay color name than any
87 other are in the mask set.
88
89 The algorithm ppmcolormask uses to determine to which colors a
90 Berlin-Kay color name applies is based on a Sugeno-type fuzzy
91 inference system developed by Kenan Kalajdzic in 2006. The
92 fuzzy model consists of partially linear membership functions
93 defined in the HSV color space. Although more complex algo‐
94 rithms for fuzzy color matching exist, this algorithm is inten‐
95 tionally simplified to achieve a satisfactory speed using rela‐
96 tively compact code.
97
98 This option was new in Netpbm 10.34 (June 2006). Before that,
99 you must use the color argument and cannot specify a Berlin-Kay
100 color.
101
102
103
104
106 pamfind(1), pambackground(1), ppmchange(1), pgmtoppm(1), pamcomp(1),
107 pbmmask(1), pnmtopng(1), ppm(1)
108
110 This manual page was generated by the Netpbm tool 'makeman' from HTML
111 source. The master documentation is at
112
113 http://netpbm.sourceforge.net/doc/ppmcolormask.html
114
115netpbm documentation 01 May 2006 Ppmcolormask User Manual(0)