Pamsumm User Manual

Pamsumm User Manual



pamsumm - Summarize the samples in a Netpbm image arithmetically


pamsumm { -sum | -mean | -min | -max } [-normalize] [-brief] [imagefile]

All options can be abbreviated to their shortest unique prefix. You may use two hyphens instead of one. You may separate an option name and its value with white space instead of an equals sign.


This program is part of Netpbm(1)

pamsumm reads a Netpbm image (PNM or PAM) and performs a summary function over all the samples in all the rows, columns, and planes and prints the result to Standard Output.

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. See the format specifications of PGM(5) , PPM(5) , and PAM(5) , 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.

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.


You must specify exactly one of -sum, -mean, -min, or -max.


This option makes the summary function addition.


This option makes the summary function arithmetic mean.


This option makes the summary function arithmetic minimum.


This option makes the summary function arithmetic maximum.


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. 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)


This option causes pamsumm to display the answer as a bare

number, rather than in a complete sentence.

This option was new in Netpbm 10.22 (April 2004)


pamsumm(1) , pam(5) ,


pamsumm was added to Netpbm in Release 10.21 (March 2004).


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.

Free Software

Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.

Free Books

The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.