NAME

replace_color - replace one color with another in an image

SYNOPSIS

  perl replace_color fromcolor tocolor inimage outimage

DESCRIPTION

This is a simple demonstration of Imager::transform2 that replaces one color with another in an image.

Note: this works with full color images, and always produces a 3 channel output image - the alpha channel (if any) is not preserved.

Most of the work is done in the replace_color() function.

replace_color

Called:

  my $result = replace_color($in_image, $from_color, $to_color);

Returns a new image object with colors replaced.

REVISION

$Revision$

AUTHOR

Tony Cook <tony@develop-help.com>

SEE ALSO

Imager, Imager::Engines, Imager::Color, Imager::Files