1Pnmhistmap User Manual(0) Pnmhistmap User Manual(0)
2
3
4
6 pnmhistmap - draw a histogram for a PGM or PPM file
7
8
10 pnmhistmap
11
12 [-black]
13
14 [-white]
15
16 [-max N]
17
18 [-verbose]
19
20 [pnmfile]
21
22
24 This program is part of Netpbm(1).
25
26 pnmhistmap reads a PNM image as input and produces an image showing a
27 histogram of the color (or gray) values in the input. A PGM input
28 results in a PBM output. A PPM input results in a PPM output with
29 three overlaid histograms: a red one for the red input, a green one for
30 the green input, and a blue one for the blue input.
31
32 For example, from the following image produces the following histogram:
33
34 image histogram from image
35
36 If the input is PBM, pnmhistmap produces an error message and no output
37 image.
38
39
41 Minimum unique abbreviation of option is acceptable. You may use dou‐
42 ble hyphens instead of single hyphen to denote options. You may use
43 white space in place of the equals sign to separate an option name from
44 its value.
45
46
47
48
49 -red
50
51 -green
52
53 -blue Include the indicated color component in the output. If you
54 specify none of these, pnmhistmap include all three.
55
56 These options are meaningless if the input is PGM.
57
58 These options were new in Netpbm 10.26 (January 2005). Before
59 that, pnmhistmap always included all three color components.
60
61
62 -dots Plot the histogram as dots. By default, pnmhistmap plots bars.
63
64 Example of dots:.B -dots example
65
66 This option was new in Netpbm 10.26 (January 2005). Before
67 that, pnmhistmap always plotted bars.
68
69
70 -lval minpixval
71
72 -rval maxpixval
73 These options specify the range of intensity values to include.
74 pnmhistmap ignores intensities less than minpixval and greater
75 than maxpixval. So the left side of the histogram corresponds
76 to minpixval and the right side corresponds to maxpixval.
77
78 By default, pnmhistmap plots the entire possible range: zero to
79 the maxval.
80
81 These options were new in Netpbm 10.26 (January 2005). Before
82 that, pnmhistmap always plotted from zero to the maxval.
83
84
85 -height
86
87 -width These options specify the dimensions, in pixels of the histogram
88 image.
89
90 The default height is 200 pixels.
91
92 The default width is one pixel for each plotted intensity value
93 (so it's controlled by the maxval of the image and the -lval and
94 -rval options). The 'count buckets' in the histogram are always
95 one pixel wide. If you specify a width less than the number of
96 plotted intensity values, a bucket represents more than one
97 intensity value. If you specify a width greater that the number
98 of plotted intensity values, some buckets represent no color
99 (the count is zero).
100
101 This option was new in Netpbm 10.26 (January 2005). Before
102 that, the dimensions were always what the default is today.
103
104
105
106
107
108
109 -black Ignore the count of black pixels when scaling the histogram.
110
111
112 -white Ignore the count of white pixels when scaling the histogram.
113
114
115
116 The -black and -white options, which can be used separately or
117 together, are useful for images with a large percentage of pixels whose
118 value is zero or 255, which can cause the remaining histogram data to
119 become unreadbaly small. Note that, for color inputs, these options
120 apply to all colors; if, for example, the input has a large number of
121 bright-red areas, you will probably want to use the -white option.
122
123
124
125 -max N Force the scaling of the histogram to use N as the largest-count
126 value. This is useful for inputs with a large percentage of
127 single-color pixels which are not black or white.
128
129
130 -verbose
131 Report the progress of making the histogram, including the
132 largest-count value used to scale the output.
133
134
135
136
137
139 pnmhistmap assumes maxval is always 255. Images with a smaller maxval
140 will only use the lower-value side of the histogram. You can overcome
141 this either by piping the input through pamdepth or by cutting and
142 scaling the lower-value side of the histogram. Neither is a particu‐
143 larly elegant solution to the problem.
144
145 The program does not allow you to specify the output size.
146
147
149 pgmhist(1), ppmhist(1), pgm(1), ppm(1)
150
151
153 Wilson H. Bent. Jr. (whb@usc.edu).
154
155
156
157netpbm documentation 25 October 1993 Pnmhistmap User Manual(0)