in reply to Re: Re: Colour Replacement in a PNG
in thread Colour Replacement in a PNG
This replaces all instances of (255,255,255) with (255,0,0). Now how do I make that red transparent? I thought I would need to do:my $redmap = [0 .. 255]; my $blumap = [0 .. 255]; my $grnmap = [0 .. 255]; $blumap->[255] = 0; $grnmap->[255] = 0; $img->map(red=>$redmap, blue=>$blumap, green=>$grnmap);
But that doesn't do anything. I like Imager for it's flexibility, but I am really getting frustrated with the documentation. Any help would be greatly appreciated.my $redmap = [0 .. 255]; my $blumap = [0 .. 255]; my $grnmap = [0 .. 255]; my $alpha = [0 .. 255]; $blumap->[255] = 0; $grnmap->[255] = 0; $alpha->[0] = 255; $img->map(red=>$redmap, blue=>$blumap, green=>$grnmap, alpha=>$alpha);
Cheers!
Aaron
|
|---|