PAMSUMM(1)
π PAMSUMM(1) β the Pamsumm User Manual, bestie edition π
okay so picture this: you've got a Netpbm image and you need the β¨mathsβ¨ on it. That's pamsumm. It lives in the Pamsumm User Manual (section 1, General Commands Manual, obviously) and it is unhinged in the best way. Let's go π¦
β¨ NAME β¨
pamsumm β summarize the samples in a Netpbm image arithmetically π
no cap, that's literally the whole job.
πΈ SYNOPSIS πΈ
pamsumm { -sum | -mean | -min | -max } [-normalize] [-brief] [imagefile]
okay quick style guide before you come for me in the replies π«Ά:
- All options can be abbreviated to their shortest unique prefix. shortest unique prefix, she said. iconic.
- You may use two hyphens instead of one. Fancy.
- You may separate an option name and its value with white space instead of an equals sign. Do it however, we don't judge π
π DESCRIPTION π
so this program is part of Netpbm(1). Family reunion.
pamsumm reads a Netpbm image (that's PNM or PAM, iykyk) and performs a summary function over all the samples in all the rows, columns, and planes β yes, ALL of them β and then prints the result to Standard Output. Main character behaviour fr fr π
big important thing bestie: pamsumm performs the operation on the actual sample values. In the case of a PGM or PPM or PAM equivalent (i.e. a visual image), this is not the same as the light intensities represented by those samples. Like, not even close. See the format specifications of PGM(1), PPM(1), and PAM(1) for the precise meanings of samples in these formats. π§
If you want to do arithmetic on light intensities of such a visual image, you can use pnmgamma to convert it to one with samples proportional to light intensity, and then use pamsumm on the result. glow-up pipeline β¨
now, if you're out here wanting something different, listen up:
- If you want to summarize by column (e.g. add up the columns separately), use
pamsummcol. - If you want to summarize by row, use a combination of
pamsummcolandpamflip. - If you want to summarize a particular plane, use
pamchannelto extract it and thenpamsumm.
choose your fighter π₯
π OPTIONS π
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamsumm recognizes the following command line options:
You must specify exactly one of -sum, -mean, -min, or -max. exactly one. not two. not zero. one. periodt. π
-sumβ This option makes the summary function addition. + bby. put it all together.-meanβ This option makes the summary function arithmetic mean. it's giving average, it's giving balance πΈ-minβ This option makes the summary function arithmetic minimum. the smallest one, the underdog, our little meow meow π₯Ί-maxβ This option makes the summary function arithmetic maximum. the biggest, the loudest, the main character π-normalizeβ This option causes each sample to be normalized to a fraction (in the range0..1) so the result is independent of the image'smaxval.
Example time, because numbers are unserious and I love them: e.g. if you request the mean of an image which has maxval 200 and all the samples have value 50, pamsumm will give you 50 as an answer. But pamsumm -normalize will give you .25. π
If instead you want a result that is independent of maxval but still in integers, you can use pamdepth to convert the input to some standard maxval and not use -normalize. For example, if you want the mean brightness of a PPM image, on a scale of 0 to 99, do:
pamdepth 99 myimage.ppm | pamsumm -mean
This option was new in Netpbm 10.22 (April 2004) β a whole adult now π
-briefβ This option causespamsummto display the answer as a bare number, rather than in a complete sentence. no yapping, just the digits. lowkey the most efficient queen in the whole suite π
This option was new in Netpbm 10.22 (April 2004) β
π¦ SEE ALSO π¦
pamsummcol(1), pam(1),
π HISTORY π
pamsumm was added to Netpbm in Release 10.21 (March 2004). a legend was born, and she ate π
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/pamsumm.html
okay bestie that's the whole vibe check β this was netpbm documentation, 26 October 2012 β Pamsumm User Manual(1). go forth, summarize arithmetically, and slay π πβ¨
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms