LinuxCommandLibrary

ppmchange

Replace specific colors in PPM images

TLDR

Change specific color

$ ppmchange [oldcolor] [newcolor] [input.ppm] > [output.ppm]
copy
Change red to blue
$ ppmchange red blue [input.ppm] > [output.ppm]
copy
Change multiple colors
$ ppmchange [old1] [new1] [old2] [new2] [input.ppm] > [output.ppm]
copy

SYNOPSIS

ppmchange [options] oldcolor newcolor [file]

DESCRIPTION

ppmchange replaces specific colors in PPM images with new colors. Multiple color substitutions can be specified in a single invocation by providing pairs of old and new colors on the command line.
By default, only exact color matches are replaced. The -closeness option allows fuzzy matching by specifying a tolerance value, useful when working with images that have slight color variations due to compression or anti-aliasing. Part of the Netpbm toolkit.

PARAMETERS

OLDCOLOR

Color to replace.
NEWCOLOR
Replacement color.
FILE
Input PPM file.
-closeness N
Color matching tolerance.

CAVEATS

Exact color matching by default. Part of Netpbm suite.

HISTORY

ppmchange was created as part of Netpbm for color replacement.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community