.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. Ppmchange User Manual - Online Linux Manual PageSection : 0
Updated : December 2016
Source : netpbm documentation
NAMEppmchange - change all pixels of one color to another in a PPM image .UN synopsis
SYNOPSISppmchange [-closeness=closeness_percent] [-remainder=remainder_color] [-closeok] [oldcolor newcolor] ... [ppmfile] .UN examples
EXAMPLESppmchange red blue redimage.ppm >blueimage.ppm
ppmchange red red -remainder=black myimage.ppm >redblack.ppm
ppmchange -closeness=10 white white black black
.UN description
DESCRIPTIONThis program is part of Netpbm(1). ppmchange reads a PPM image as input and changes all pixels of color oldcolor to color newcolor. You may specify up to 256 oldcolor/newcolor pairs on the command line. ppmchange leaves all colors not mentioned unchanged, unless you specify the -remainder option, in which case they are all changed to the single specified color. You can specify that colors similar, but not identical, to the ones you specify get replaced by specifying a "closeness" factor. Specify the colors as described for the argument of the pnm_parsecolor() library routine . If a pixel matches two different oldcolors, ppmchange replaces it with the newcolor of the leftmost specified one. The maxval of the output image is the same as that of the input image. If a newcolor you specify cannot be exactly represented in that maxval, ppmchange assumes a color that is as close as possible to what you specified but can be represented with your maxval. Unless you specify the -closeok option, ppmchange issues a warning that it is using an approximation. A common way that you can have this maxval problem, where the color you specify cannot be represented with your maxval, is that your input is a PBM (black and white) image that you are colorizing. The maxval in this case is 1, which severely limits the colors to which you can change. To avoid this problem, use pamdepth to make the maxval of your input something consistent with your colors. 255 is usually a good choice. Before Netpbm 10.22 (April 2004), ppmchange always behaved as if the user specified -closeok, and there was no -closeok option. .UN options
OPTIONSIn addition to the options common to all programs based on libnetpbm (most notably -quiet, see
Common 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 the description section for details. This option was new in Netpbm 10.22 (April 2004). Before that, ppmchange always behaved as if you specified this option. -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, or ppmchange -remainder=black red white | ppmtopgm
to create a mask file for the red portions of the image. .UN seealso
SEE ALSO"pgmtoppm(1), "ppmcolormask(1), "ppm(1) .UN author
AUTHORWilson H. Bent. Jr. (whb@usc.edu) with modifications by Alberto Accomazzi (alberto@cfa.harvard.edu)
DOCUMENT SOURCEThis manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at http://netpbm.sourceforge.net/doc/ppmchange.html 0
Johanes Gumabo
Data Size : 15,523 byte
man-ppmchange.1Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 184,864
Visitor ID : :
Visitor IP : 3.145.16.251 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (rof_escape_sequence|91|ppmchange.1|1/2|\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
) (parse_manual_page_|249|ppmchange.1|1/2|\"|.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
) (parse_manual_page_|249|ppmchange.1|11|UN|.UN synopsis
) (parse_manual_page_|249|ppmchange.1|22|UN|.UN examples
) (parse_manual_page_|249|ppmchange.1|35|UN|.UN description
) (parse_manual_page_|249|ppmchange.1|82|UN|.UN options
) (parse_manual_page_|249|ppmchange.1|159|UN|.UN seealso
) (parse_manual_page_|249|ppmchange.1|168|UN|.UN author
)