| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pamsumm User Manual" 1 "26 October 2012" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pamsumm - Summarize the samples in a Netpbm image arithmetically |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
\fBpamsumm\fP |
| 14 |
{ |
| 15 |
\fB-sum\fP | |
| 16 |
\fB-mean\fP | |
| 17 |
\fB-min\fP | |
| 18 |
\fB-max\fP |
| 19 |
} |
| 20 |
[\fB-normalize\fP] |
| 21 |
[\fB-brief\fP] |
| 22 |
[\fIimagefile\fP] |
| 23 |
.PP |
| 24 |
All options can be abbreviated to their shortest unique prefix. |
| 25 |
You may use two hyphens instead of one. You may separate an option |
| 26 |
name and its value with white space instead of an equals sign. |
| 27 |
|
| 28 |
.UN description |
| 29 |
.SH DESCRIPTION |
| 30 |
.PP |
| 31 |
This program is part of |
| 32 |
.BR "Netpbm" (1)\c |
| 33 |
\&. |
| 34 |
.PP |
| 35 |
\fBpamsumm\fP reads a Netpbm image (PNM or PAM) and performs a |
| 36 |
summary function over all the samples in all the rows, columns, and planes |
| 37 |
and prints the result to Standard Output. |
| 38 |
.PP |
| 39 |
\fBpamsumm\fP performs the operation on the actual sample values. In the |
| 40 |
case of a PGM or PPM or PAM equivalent (i.e. a visual image), this is not the |
| 41 |
same as the light intensities represented by those samples. See the format |
| 42 |
specifications of |
| 43 |
.BR "PGM" (1)\c |
| 44 |
\&, |
| 45 |
.BR "PPM" (1)\c |
| 46 |
\&, and |
| 47 |
.BR "PAM" (1)\c |
| 48 |
\&, for the precise |
| 49 |
meanings of samples in these formats. If you want to do arithmetic on light |
| 50 |
intensities of such a visual image, you can use \fBpnmgamma\fP to convert it |
| 51 |
to one with samples proportional to light intensity, and then |
| 52 |
use \fBpamsumm\fP on the result. |
| 53 |
.PP |
| 54 |
If you want to summarize by column (e.g. add up the columns |
| 55 |
separately), use \fBpamsummcol\fP. If you want to summarize by row, |
| 56 |
use a combination of \fBpamsummcol\fP and \fBpamflip\fP. If you |
| 57 |
want to summarize a particular plane, use \fBpamchannel\fP to |
| 58 |
extract it and then \fBpamsumm\fP. |
| 59 |
|
| 60 |
|
| 61 |
.UN options |
| 62 |
.SH OPTIONS |
| 63 |
.PP |
| 64 |
In addition to the options common to all programs based on libnetpbm |
| 65 |
(most notably \fB-quiet\fP, see |
| 66 |
.UR index.html#commonoptions |
| 67 |
Common Options |
| 68 |
.UE |
| 69 |
\&), \fBpamsumm\fP recognizes the following |
| 70 |
command line options: |
| 71 |
.PP |
| 72 |
You must specify exactly one of \fB-sum\fP, \fB-mean\fP, |
| 73 |
\fB-min\fP, or \fB-max\fP. |
| 74 |
|
| 75 |
|
| 76 |
.TP |
| 77 |
\fB-sum\fP |
| 78 |
.sp |
| 79 |
This option makes the summary function addition. |
| 80 |
|
| 81 |
.TP |
| 82 |
\fB-mean\fP |
| 83 |
.sp |
| 84 |
This option makes the summary function arithmetic mean. |
| 85 |
|
| 86 |
.TP |
| 87 |
\fB-min\fP |
| 88 |
.sp |
| 89 |
This option makes the summary function arithmetic minimum. |
| 90 |
|
| 91 |
.TP |
| 92 |
\fB-max\fP |
| 93 |
.sp |
| 94 |
This option makes the summary function arithmetic maximum. |
| 95 |
|
| 96 |
.TP |
| 97 |
\fB-normalize\fP |
| 98 |
.sp |
| 99 |
This option causes each sample to be normalized to a fraction |
| 100 |
(in the range 0..1) so the result is independent of the image's |
| 101 |
maxval. E.g. if you request the mean of an image which has maxval |
| 102 |
200 and all the samples have value 50, \fBpamsumm\fP will give you |
| 103 |
50 as an answer. But \fBpamsumm -normalize\fP will give you .25. |
| 104 |
.sp |
| 105 |
If instead you want a result that is independent of maxval but still |
| 106 |
in integers, you can use \fBpamdepth\fP to convert the input to some |
| 107 |
standard maxval and not use \fB-normalize\fP. For example, if you want |
| 108 |
the mean brightness of a PPM image, on a scale of 0 to 99, do |
| 109 |
|
| 110 |
.nf |
| 111 |
\f(CW |
| 112 |
pamdepth 99 myimage.ppm | pamsumm -mean |
| 113 |
\fP |
| 114 |
|
| 115 |
.fi |
| 116 |
.sp |
| 117 |
This option was new in Netpbm 10.22 (April 2004) |
| 118 |
|
| 119 |
.TP |
| 120 |
\fB-brief\fP |
| 121 |
.sp |
| 122 |
This option causes \fBpamsumm\fP to display the answer as a bare |
| 123 |
number, rather than in a complete sentence. |
| 124 |
.sp |
| 125 |
This option was new in Netpbm 10.22 (April 2004) |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
.UN seealso |
| 130 |
.SH SEE ALSO |
| 131 |
.BR "pamsummcol" (1)\c |
| 132 |
\&, |
| 133 |
.BR "pam" (1)\c |
| 134 |
\&, |
| 135 |
|
| 136 |
.UN history |
| 137 |
.SH HISTORY |
| 138 |
.PP |
| 139 |
\fBpamsumm\fP was added to Netpbm in Release 10.21 (March |
| 140 |
2004). |
| 141 |
.SH DOCUMENT SOURCE |
| 142 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 143 |
source. The master documentation is at |
| 144 |
.IP |
| 145 |
.B http://netpbm.sourceforge.net/doc/pamsumm.html |
| 146 |
.PP |