pamrecolor
changes the colors of an image while preserving luminance
TLDR
Colorize grayscale image
$ pamrecolor -colorfile [color.ppm] [gray.ppm] > [output.ppm]
Apply color from solid$ pamrecolor -targetcolor "rgb:ff/00/00" [gray.ppm] > [red.ppm]
Preserve luminance$ pamrecolor -colorfile [palette.ppm] -rmult [1.0] [input.ppm] > [output.ppm]
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
pamrecolor -targetcolor "rgb:94/6d/50" old_photo.ppm > sepia.ppm
# Apply palette from reference
pamrecolor -colorfile reference.ppm target.ppm > recolored.ppm
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.
