NAME
ppmhist - print a histogram of the colors in a PPM imageSYNOPSIS
ppmhist [ -hexcolor | -float | -colorname | -map] [ -nomap] [ -noheader] [ -sort={frequency, rgb}] [ -forensic] [ ppmfile]DESCRIPTION
This program is part of Netpbm(1). ppmhist reads a PPM image as input and generates a histogram of the colors in the image, i.e. a list of all the colors and how many pixels of each color are in the image.Output Format
The output is in one of two basic formats: a report for humans and a PPM image for use by programs. The PPM image is actually quite readable by humans too.OPTIONS
In addition to the options common to all programs based on libnetpbm (most notably -quiet, seeCommon Options ), ppmhist recognizes the following command line options:
- -sort={frequency,rgb}
- The -sort option determines the order in which the colors are listed in the output. rgb means to sort them first by the intensity of the red component of the color, then of the green, then of the blue, with the least intense first. frequency means to list them in order of how many pixels in the input image have the color, with the most represented colors first. Among colors with the same frequency, the order is the same as with rgb. The default is frequency. Before Netpbm 10.88 (September 2019), with -sort=frequency, the order of colors that have the same frequency is arbitrary.
- -hexcolor
- Print the color components in hexadecimal. See
- -float
- Print the color components and the luminosity as floating point numbers in the range [0,1]. See
- -map
- Generates a PPM file of the colormap for the image, with the color histogram as comments. See
- -nomap
- Generates the histogram for human reading. This is the default.
- -colorname
- Add the color name to the output. This is the name from the
- -noheader
- Do not print the column headings.
- -forensic
- With this option, ppmhist works on images that contain invalid sample values. Normally, like most Netpbm programs, ppmhist fails if it encounters a sample value greater than the maxval that the image declares. The presence of such a value means the image is invalid, so the pixels have no meaning. But with -forensic, ppmhist produces a histogram of the actual sample values without regard to maxval. It issues messages summarizing the invalid pixels if there are any. One use for this is to diagnose the problem that caused the invalid Netpbm image to exist. There is a small exception to the ability of ppmhist to process invalid pixels even with -forensic: it can never process a sample value greater than 65535. Note that in the rarely used Plain PPM format, it is possible for a number greater than that to appear where a sample value belongs. This option was new in Netpbm 10.66 (March 2014). But Netpbm older than 10.66 does not properly reject invalid sample values, so the effect is very similar to -forensic.
SEE ALSO
ppm(1), pgmhist(1), pnmcolormap(1), pnmhistmap(1), ppmchange(1)AUTHOR
Copyright (C) 1989 by Jef Poskanzer.DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at24 August 2019 | netpbm documentation |