ppmchange(1)


NAME

   ppmchange  -  change  all  pixels of one color to another in a portable
   pixmap

SYNOPSIS

   ppmchange [ -closeness closeness_percent ] [ -remainder remainder_color
   ] [ oldcolor newcolor ] ...  [ppmfile]

DESCRIPTION

   Reads  a  portable  pixmap as input.  Changes all pixels of oldcolor to
   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.

   The colors can be specified in five ways:

   o      A name, assuming that a pointer to an X11-style color names file
          was compiled in.

   o      An  X11-style  hexadecimal specifier: rgb:r/g/b, where r g and b
          are each 1- to 4-digit hexadecimal numbers.

   o      An X11-style decimal specifier: rgbi:r/g/b, where r g and b  are
          floating point numbers between 0 and 1.

   o      For   backwards   compatibility,  an  old-X11-style  hexadecimal
          number: #rgb, #rrggbb, #rrrgggbbb, or #rrrrggggbbbb.

   o      For backwards compatibility, a triplet of numbers  separated  by
          commas:  r,g,b,  where  r  g  and  b  are floating point numbers
          between 0 and 1.  (This style was added before MIT came up  with
          the similar rgbi style.)

          If  a  pixel matches two different oldcolors, ppmchange replaces
          it with the newcolor of the leftmost specified one.

OPTIONS

   -closeness closeness_percent
          closeness is an integer per centage 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.

          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.

   -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.

SEE ALSO

   pgmtoppm(1), ppmcolormask(1), ppm(5)

AUTHOR

   Wilson  H.  Bent.  Jr.  (whb@usc.edu)  with  modifications  by  Alberto
   Accomazzi (alberto@cfa.harvard.edu)

                            07 January 2001                   ppmchange(1)


More Linux Commands

manpages/fconfigure.n.html
fconfigure(n) - Set and get options on a channel (Man Page)
The fconfigure command sets and retrieves options for channels. ChannelId identifies the channel for which to set or query an option and must refer to an open c

manpages/XUnionRegion.3.html
XUnionRegion(3) - region arithmetic - Linux manual page.....
The XIntersectRegion function computes the intersection of two regions. The XUnionRegion function computes the union of two regions. The XUnionRectWithRegion fu

manpages/exit.2.html
exit(2) - terminate the calling process - Linux manual page
The function _exit() terminates the calling process immediately. Any open file descriptors belonging to the process are closed; any children of the process are

manpages/pam_timestamp_check.8.html
pam_timestamp_check(8) - Check to see if the default timesta
With no arguments pam_timestamp_check will check to see if the default timestamp is valid, or optionally remove it. OPTIONS -k Instead of checking the validity

manpages/va_arg.3.html
va_arg(3) - variable argument lists - Linux manual page.....
A function may be called with a varying number of arguments of varying types. The include file <stdarg.h> declares a type va_list and defines three macros for s

manpages/gnutls_dh_get_pubkey.3.html
gnutls_dh_get_pubkey(3) - API function - Linux manual page
This function will return the peers public key used in the last Diffie-Hellman key exchange. This function should be used for both anonymous and ephemeral Diffi

manpages/filter.3x.lc.html
filter.3x(lc) miscellaneous curses utility routines.........
The unctrl routine returns a character string which is a printable representation of the character c, ignoring attributes. Control characters are displayed in t

manpages/gnutls_deinit.3.html
gnutls_deinit(3) - API function (Library - Linux man page)
This function clears all buffers associated with the session. This function will also remove session data from the session database if the session was terminate

manpages/pcre16_get_stringtable_entries.3.html
pcre16_get_stringtable_entries(3) Perl-compatible regular ex
This convenience function finds, for a compiled pattern, the first and last entries for a given name in the table that translates capturing parenthesis names in

manpages/curl_share_strerror.3.html
curl_share_strerror(3) - return string describing error code
The curl_share_strerror() function returns a string describing the CURLSHcode error code passed in the argument errornum. AVAILABILITY This function was added i

manpages/sendinpaths.8.html
sendinpaths(8) - Send Usenet Path: statistics via e-mail....
sendinpaths checks pathlog/path for ninpaths dump files, finds dump files generated in the past 30 days, makes sure they are valid by running ninpaths on each o

manpages/makedbz.8.html
makedbz(8) - Rebuild dbz files (Admin - Linux man page).....
makedbz rebuilds dbz(3) database. The default name of the text file is pathdb/history; to specify a different name, use the -f flag. OPTIONS -f filename If the





We can't live, work or learn in freedom unless the software we use is free.