about summary refs log tree commit diff
path: root/pnmhistmap.html
blob: 45d706633959ac525f78fe04efcc7f05cd69843e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Pnmhistmap User Manual</TITLE></HEAD>
<BODY>
<H1>pnmhistmap</H1>
Updated: 25 October 1993
<BR>
<A HREF="#index">Table Of Contents</A>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

pnmhistmap - draw a histogram for a PGM or PPM file

<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>pnmhistmap</B>

[<B>-black</B>]

[<B>-white</B>]

[<B>-max</B> <I>N</I>]

[<B>-verbose</B>]

[<I>pnmfile</I>]

<P>Minimum unique abbreviation of option is acceptable.  You may use
double hyphens instead of single hyphen to denote options.  You may use
white space in place of the equals sign to separate an option name
from its value.


<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pnmhistmap</b> reads a PNM image as input and produces an image
showing a histogram of the color (or gray) values in the input.  A PGM
input results in a PBM output.  A PPM input results in a PPM output
with three overlaid histograms: a red one for the red input, a green
one for the green input, and a blue one for the blue input.

<p>For example, from the following image produces the following histogram:

<p><img src="testimg.png" alt="image">
<img src="testimg_histbar.png" alt="histogram from image">

<p>If the input is PBM, <b>pnmhistmap</B> produces an error message
and no output image.

<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<dl>

<dt><b>-red</b>
<dt><b>-green</b>
<dt><b>-blue</b>

<dd>Include the indicated color component in the output.  If you
specify none of these, <b>pnmhistmap</b> include all three.

<p>These options are meaningless if the input is PGM.

<p>These options were new in Netpbm 10.26 (January 2005).  Before
that, <b>pnmhistmap</b> always included all three color components.

<dt><b>-dots</b>

<dd>Plot the histogram as dots.  By default, <b>pnmhistmap</b> plots
bars.

<p>Example of dots: <img src="testimg_histdot.png" alt="-dots example">

<p>This option was new in Netpbm 10.26 (January 2005).  Before that,
<b>pnmhistmap</b> always plotted bars.

<dt><b>-lval</b> <i>minpixval</i>
<dt><b>-rval</b> <i>maxpixval</i>

<dd>These options specify the range of intensity values to include.
<b>pnmhistmap</b> ignores intensities less than <i>minpixval</i> and
greater than <i>maxpixval</i>.  So the left side of the histogram
corresponds to <i>minpixval</i> and the right side corresponds to
<i>maxpixval</i>.

<p>By default, <b>pnmhistmap</b> plots the entire possible range: zero
to the maxval.

<p>These options were new in Netpbm 10.26 (January 2005).  Before that,
<b>pnmhistmap</b> always plotted from zero to the maxval.

<dt>-height
<dt>-width

<dd>These options specify the dimensions, in pixels of the histogram image.

<p>The default height is 200 pixels.

<p>The default width is one pixel for each plotted intensity value (so it's 
controlled by the maxval of the image and the <b>-lval</b> and <b>-rval</b>
options).  The &quot;count buckets&quot; in the histogram are always
one pixel wide.  If you specify a width less than the number of plotted
intensity values, a bucket represents more than one intensity value.
If you specify a width greater that the number of plotted intensity values,
some buckets represent no color (the count is zero).

<p>This option was new in Netpbm 10.26 (January 2005).  Before that,
the dimensions were always what the default is today.

</dl>


<DL COMPACT>
<DT><B>-black </B>

<DD>Ignore the count of black pixels when scaling the histogram.

<DT><B>-white</B>

<DD>Ignore the count of white pixels when scaling the histogram.

</DL>

<P>The -black and -white options, which can be used separately or
together, are useful for images with a large percentage of pixels
whose value is zero or 255, which can cause the remaining histogram
data to become unreadbaly small.  Note that, for pixmap inputs, these
options apply to all colors; if, for example, the input has a large
number of bright-red areas, you will probably want to use the -white
option.

<DL COMPACT>
<DT><B>-max N</B>

<DD>Force the scaling of the histogram to use N as the largest-count value.
This is useful for inputs with a large percentage of single-color pixels
which are not black or white.

<DT><B>-verbose</B>

<DD>Report the progress of making the histogram, including the largest-count
value used to scale the output.

</DL>


<A NAME="lbAF">&nbsp;</A>
<H2>LIMITATIONS</H2>

<P><b>pnmhistmap</b> assumes maxval is always 255.  Images with a
smaller maxval will only use the lower-value side of the histogram.
You can overcome this either by piping the input through
<b>pamdepth</b> or by cutting and scaling the lower-value side of the
histogram.  Neither is a particularly elegant solution to the problem.

<P>The program does not allow you to specify the output size.

<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>

<A HREF="pgmhist.html">pgmhist</A>,
<A HREF="ppmhist.html">ppmhist</A>,
<A HREF="pgm.html">pgm</A>,
<A HREF="ppm.html">ppm</A>

<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>

<p>Wilson H. Bent. Jr. (<A HREF="mailto:whb@usc.edu">whb@usc.edu</A>).

<HR>
<A NAME="index">&nbsp;</A>
<H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#lbAB">NAME</A>
<LI><A HREF="#lbAC">SYNOPSIS</A>
<LI><A HREF="#lbAD">DESCRIPTION</A>
<LI><A HREF="#lbAE">OPTIONS</A>
<LI><A HREF="#lbAF">BUGS</A>
<LI><A HREF="#lbAG">SEE ALSO</A>
<LI><A HREF="#lbAH">AUTHOR</A>
</UL>
</BODY>
</HTML>