(none) imager-devel
/ help / lists / applications / search /
 

Re: Replacing one colour with a different (transparent) colour (PNG)

From: Tony Cook (
11669@xyz.molar.is)
Date: Thu 05 Feb 2004 - 22:11:22 GMT

  • Next message: Guus: "Imager on Debian GNU/Linux"

    On Thu, Feb 05, 2004 at 02:53:53PM -0700, Aaron Dalton wrote:
    > Thank you again, Tony, for your time. I implemented your code but am
    > receiving the following error "Imager::transform2: Call to and with
    > incorrect types" Below is the code:
    >
    > sub replaceColour
    > {
    > my ($img, $inred, $ingreen, $inblue, $outred, $outgreen, $outblue,
    > $outalpha) = @_;
    >
    > my $out = Imager::transform2(
    > {
    > channels=>4,
    > rpnexpr => 'x y getp1 !p @p red inred eq @p green ingreen eq and @p
    > inblue 255 eq' .
    > ' and outred outgreen outblue outalpha rgba @p red @p green @p blue
    > 255 rgba if',

    Oops, I made a mistake when editing the expression, it should be:

    rpnexpr => 'x y getp1 !p @p red inred eq @p green ingreen eq and @p
    blue inblue eq and outred outgreen outblue outalpha rgba @p red @p green @p blue 255 rgba if',

    Tony



  •