Ppmhist User Manual(0)                   Ppmhist User Manual(0)



Table Of Contents


NAME
       ppmhist - print a histogram of the colors in a PPM image


SYNOPSIS
       ppmhist  [-hexcolor  |  -float  |  -colorname  |   -map]
       [-nomap] [-noheader] [-sort={frequency,rgb}] [ppmfile]


DESCRIPTION
       This program is part of Netpbm(1).

       ppmhistreads  a  PPM image as input and generates a his-
       togram 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 one line  for  each  color  in  the  input
       image.

       By  default, there are two lines of column header at the
       top.  Use the -noheader option to suppress those  lines.

       In  each  line,  ppmhist  identifies  the  color by red,
       green, and blue components.  By default, it  lists  each
       of  these in decimal, using the exact values that are in
       the PPM input.  So if the image has a maxval of 255, the
       numbers  in  the  listing range from 0 to 255.  With the
       -hexcolor option, you can change these numbers to  hexa-
       decimal.   With the -float option, the numbers are frac-
       tional, adjusted to a maxval of 1.

       Each line lists the luminosity of the color.  It  is  in
       decimal on the same scale as the rgb values (see above).

       Each line lists the number of pixels in the  image  that
       have the color.  This is in decimal.


OPTIONS
       -sort={frequency,rgb}
              The  -sort  option  determines the order in which
              the colors are listed in the  output.   frequency
              means  to list them in order of how pixels in the
              input image have the color, with the most  repre-
              sented  colors  first.   rgb  means  to sort them
              first by the intensity of the  red  component  of
              the  color,  the  of the green, then of the blue,
              with the least intense first.

              The default is frequency.


       -hexcolor
              Print the color components in  hexadecimal.   See
              output format .

              You may not specify this option along with -float
              or map.


       -float Print the color components and the luminosity  as
              floating  point  numbers in the range [0,1].  See
              output format .

              You may not specify this option along with  -hex-
              color or map.

              This  option  was added in Netpbm 10.19 (November
              2003).


       -map   Generates a PPM file  of  the  colormap  for  the
              image, with the color histogram as comments.  See
              output format .

              You may not specify this option along with -float
              or hexcolor.


       -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 system color dictionary .  If the
              exact color is not in the color dictionary, it is
              the  closest  color that is in the dictionary and
              is preceded by a '*'.  If you don't have a system
              color dictionary, the program fails.

              This  option  was  added in Netpbm 10.10 (October
              2002).


       -noheader
              Do not print the column headings.




SEE ALSO
       ppm(1), pgmhist(1), pnmcolormmap(1), pnmhistmap(1), ppm-
       change(1)


AUTHOR
       Copyright (C) 1989 by Jef Poskanzer.



netpbm documentation    22 October 2003  Ppmhist User Manual(0)
