LinuxCommandLibrary

pamrecolor

changes the colors of an image while preserving luminance

TLDR

Colorize grayscale image

$ pamrecolor -colorfile [color.ppm] [gray.ppm] > [output.ppm]
copy
Apply color from solid
$ pamrecolor -targetcolor "rgb:ff/00/00" [gray.ppm] > [red.ppm]
copy
Preserve luminance
$ pamrecolor -colorfile [palette.ppm] -rmult [1.0] [input.ppm] > [output.ppm]
copy

SYNOPSIS

pamrecolor [options] [pamfile]

DESCRIPTION

pamrecolor changes the colors of an image while preserving luminance. It can colorize grayscale images or remap colors from one image using colors from another.

PARAMETERS

-colorfile file

Source color image.
-targetcolor color
Single target color.
-rmult, -gmult, -bmult factor
Channel multipliers.

EXAMPLE

$ # Colorize old photo with sepia
pamrecolor -targetcolor "rgb:94/6d/50" old_photo.ppm > sepia.ppm

# Apply palette from reference
pamrecolor -colorfile reference.ppm target.ppm > recolored.ppm
copy

CAVEATS

Results depend on luminance preservation. Works best on grayscale or low-saturation images.

HISTORY

pamrecolor is part of Netpbm, providing color manipulation tools for image processing.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community