.TH pgmnorm 1 "28 February 1989" .IX pgmnorm .SH NAME pgmnorm - normalize the contrast in a portable graymap .SH SYNOPSIS .B pgmnorm .RB [ -bpercent .I N | .B -bvalue .IR N ] .RB [ -wpercent .I N | .B -wvalue .IR N ] .RI [ pgmfile ] .SH DESCRIPTION Reads a portable graymap as input. Normalizes the contrast by forcing the lightest pixels to white, the .IX "contrast normalization" darkest pixels to black, and linearly rescaling the ones in between; and produces a portable graymap as output. .SH OPTIONS .PP By default, the darkest 2 percent of all pixels are mapped to black, and the lightest 1 percent are mapped to white. You can override these percentages by using the .B -bpercent and .B -wpercent flags, or you can specify the exact pixel values to be mapped by using the .B -bvalue and .B -wvalue flags. Appropriate numbers for the flags can be gotten from the .I pgmhist tool. .IX pgmhist If you just want to enhance the contrast, then choose values at elbows in the histogram; e.g. if value 29 represents 3% of the image but value 30 represents 20%, choose 30 for .IR bvalue . If you want to lighten the image, then set .I bvalue to 0 and just fiddle with .IR wvalue ; similarly, to darken the image, set .I wvalue to maxval and play with .IR bvalue . .PP All flags can be abbreviated to their shortest unique prefix. .SH "SEE ALSO" pgmhist(1), ppmnorm(1), pgm(5) .SH AUTHOR Partially based on the fbnorm filter in Michael Mauldin's "Fuzzy Pixmap" package. Copyright (C) 1989 by Jef Poskanzer. .\" Permission to use, copy, modify, and distribute this software and its .\" documentation for any purpose and without fee is hereby granted, provided .\" that the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. This software is provided "as is" without express or .\" implied warranty.