-->
Page 408
ppmhistPrint a histogram of a portable pixmap
SYNOPSIS
ppmhist [ppmfile]
DESCRIPTION
ppmhist reads a portable pixmap as input and generates a histogram of the colors in the pixmap.
SEE ALSO
ppm(5), pgmhist(1)
AUTHOR
Copyright" 1989 by Jef Poskanzer.
3 April 1989
ppmmakeCreate a pixmap of a specified size and color
SYNOPSIS
ppmmake color width height
DESCRIPTION
ppmmake produces a portable pixmap of the specified color, width, and height.
The color can be specified in five ways:
SEE ALSO
ppm(5), pbmmake(1)
AUTHOR
Copyright" 1991 by Jef Poskanzer.
24 September 1991
ppmmixBlend together two portable pixmaps
SYNOPSIS
ppmmix fadefactor ppmfile1 ppmfile2
Page 409
DESCRIPTION
ppmmix reads two portable pixmaps as input and mixes them together using the specified fade factor. The fade factor may be in the range from 0.0 (only ppmfile1's image data) to 1.0 (only ppmfile2's image data). Anything in between gains a smooth blend between the two images.
The two pixmaps must have the same size.
SEE ALSO
ppm(5)
AUTHOR
Copyright" 1993 by Frank Neumann.
16 November 1993
ppmnormNormalize the contrast in a portable pixmap
SYNOPSIS
ppmnorm[-bpercent N | -bvalue N][-wpercent N | -wvalue N][ppmfile]
DESCRIPTION
ppmnorm reads a portable pixmap as input; normalizes the contrast by forcing the lightest pixels to white, the darkest pixels to black, and linearly rescaling the ones in between; and produces a portable pixmap as output.
It works by computing the relative gray level of each pixel as with ppmtopgm, and uses those values to scale the RGB levels. Note that this is different from using pgmnorm on the individual red, green, and blue graymaps (as produced by ppmtorgb3) and recombining them.
OPTIONS
By default, the darkest two percent of all pixels are mapped to black, and the lightest one percent are mapped to white. You can override these percentages by using the -bpercent and -wpercent flags, or you can specify the exact pixel values to be mapped by using the -bvalue and -wvalue flags. Appropriate numbers for the flags can be gotten from the ppmhist tool. If you just want to enhance the contrast, then choose values at elbows in the histogram; for example, if value 29 represents 3 percent of the image but value 30 represents 20 percent, choose 30 for bvalue. If you want to lighten the image, then set bvalue to 0 and just fiddle with wvalue; similarly, to darken the image, set wvalue to maxval and play with bvalue.
All flags can be abbreviated to their shortest unique prefix.
SEE ALSO
pgmnorm(1), ppmhist(1), ppm(5)
AUTHOR
Wilson H. Bent, Jr. (whb@usc.edu), heavily based on the pgmnorm filter by Jef Poskanzer.
7 October 1993
ppmntscMake a portable pixmap look like it is taken from an American TV show
SYNOPSIS
ppmntsc dimfactor [ppmfile]
Page 410
DESCRIPTION
ppmntsc reads a portable pixmap as input and dims every other row of image data down by the specified dim factor. This factor may be in the range of 0.0 (the alternate lines are totally black) to 1.0 (original image).
This creates an effect similar to what I saw once in the video clip "You Could be Mine" by Guns'n' Roses. In the scene I'm talking about you can see John Connor on his motorbike, looking up from the water trench (?) he's standing in. While the camera pulls back, the image becomes "normal" by brightening up the alternate rows of it. I thought this would be an interesting effect to try in MPEG. I did not yet check this out, however. Try for yourself.
SEE ALSO
ppm(5), ppmdim(1)
AUTHOR
Copyright" 1993 by Frank Neumann.
16 November 1993
ppmpatMake a pretty pixmap
SYNOPSIS
ppmpat -gingham2|-g2|-gingham3| -g3|-madras|-tartan| -poles|-squig|-camo| -anticamo width height
DESCRIPTION
ppmpat produces a portable pixmap of the specified width and height, with a pattern in it.
This program is mainly to demonstrate use of the ppmdraw routines, a simple but powerful drawing library. See the ppmdraw.h include file for more information on using these routines. Still, some of the patterns can be rather pretty. If you have a color workstation, something like ppmpat -squig 300 300 | "ppmquant 128" should generate a nice background.
OPTIONS
The different flags specify various different pattern types:
-gingham2 | A gingham check pattern. Can be tiled. |
-gingham3 | A slightly more complicated gingham. Can be tiled. |
-madras | A madras plaid. Can be tiled. |
-tartan | A tartan plaid. Can be tiled. |
-poles | Color gradients centered on randomly placed poles. May need to be run through ppmquant. |
-squig | Squiggly tubular pattern. Can be tiled. May need to be run through ppmquant. |
-camo | Camouflage pattern. May need to be run through ppmquant. |
-anticamo | Anticamouflage pattern; like -camo, but ultra-bright colors. May need to be run through ppmquant. |
All flags can be abbreviated to their shortest unique prefix.
REFERENCES
Some of the patterns are from "Designer's Guide to Color 3" by Jeanne Allen.
SEE ALSO
pnmtile(1), ppmquant(1), ppm(5)
Page 411
AUTHOR
Copyright" 1989 by Jef Poskanzer.
4 September 1989
ppmquantQuantize the colors in a portable pixmap down to a specified number
SYNOPSIS
ppmquant [-floyd|-fs] ncolors [ppmfile] ppmquant [-floyd|-fs] -map mapfile [ppmfile]
DESCRIPTION
ppmquant reads a portable pixmap as input. It chooses ncolors colors to best represent the image, maps the existing colors to the new ones, and writes a portable pixmap as output.
The quantization method is Heckbert's "median cut."
Alternately, you can skip the color-choosing step by specifying your own set of colors with the -map flag. The mapfile is just a ppm file; it can be any shape, all that matters is the colors in it. For instance, to quantize down to the 8-color IBM TTL color set, you might use the following:
P3 8 1 255 0 0 0 255 0 0 0 255 0 0 0 255 255 255 0 255 0 255 0 255 255 255 255 255
If you want to quantize one pixmap to use the colors in another one, just use the second one as the mapfile. You don't have to reduce it down to only one pixel of each color, just use it as is.
The -floyd/-fs flag enables a Floyd-Steinberg error diffusion step. Floyd-Steinberg gives vastly better results on images where the unmodified quantization has banding or other artifacts, especially when going to a small number of colors such as the preceding IBM set. However, it does take substantially more CPU time, so the default is off.
All flags can be abbreviated to their shortest unique prefix.
REFERENCES
"Color Image Quantization for Frame Buffer Display," by Paul Heckbert, SIGGRAPH '82 Proceedings, page 297.
SEE ALSO
ppmquantall(1), pnmdepth(1), ppmdither(1), ppm(5)
AUTHOR
Copyright" 1989, 1991 by Jef Poskanzer.
12 January 1991