NAME
ppmchange - change all pixels of one color to another in a PPM imageSYNOPSIS
ppmchangeEXAMPLES
ppmchange red blue redimage.ppm >blueimage.ppm ppmchange red red -remainder=black myimage.ppm >redblack.ppm ppmchange -closeness=10 white white black black
DESCRIPTION
This program is part of Netpbm(1). ppmchange reads a PPM image as input and changes all pixels of color oldcolor to color newcolor.OPTIONS
In addition to the options common to all programs based on libnetpbm (most notably -quiet, seeCommon Options ), ppmchange recognizes the following command line options:
- -closeness closeness_percent
- closeness is a percentage indicating how close to the color you specified a pixel must be to get replaced. By default, it is 0, which means the pixel must be the exact color you specified. A pixel gets replaced if the distance in color between it and the color you specified is less than or equal to closeness per cent of the maxval. The "distance" in color is defined as the Cartesian sum of the individual differences in red, green, and blue intensities between the two pixels, normalized so that the difference between black and white is 100%. This is probably simpler than what you want most the time. You probably would like to change colors that have similar chrominance, regardless of their intensity. So if there's a red barn that is variously shadowed, you want the entire barn changed. But because the shadowing significantly changes the color according to ppmchange's distance formula, parts of the barn are probably about as distant in color from other parts of the barn as they are from green grass next to the barn. Maybe ppmchange will be enhanced some day to do chrominance analysis. This option was new in Netpbm 9.8 (September 2000).
- -closeok
- This option affects how ppmchange interprets a color you specify in the arguments. When you specify this option, ppmchange may use a color close to, but not the same as what you specify. See
- -remainder color
-
ppmchange changes all pixels which are not of a
color for which you specify an explicit replacement color on the command
line to color color.
An example application of this is
ppmchange -remainder=black red red
to lift only the red portions from an image, orppmchange -remainder=black red white | ppmtopgm
to create a mask file for the red portions of the image.
SEE ALSO
pgmtoppm(1), ppmcolormask(1), ppm(1)AUTHOR
Wilson H. Bent. Jr. ( [email protected]) with modifications by Alberto Accomazzi ( [email protected])DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is atDecember 2016 | netpbm documentation |