PAMSUMM(1)

πŸ“¦
version 11.13.03 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… 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 pamsummcol and pamflip.
  • If you want to summarize a particular plane, use pamchannel to extract it and then pamsumm.

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 range 0..1) so the result is independent of the image's maxval.

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 causes pamsumm to 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