Page 1 of 1

[done] How to combine image from R+G+B channels in Perl?

Posted: 2009-08-27T13:06:36-07:00
by vassapup
Hello!
I wander how to combine 3 grey channels into RGB composite by a Perl script.

I tried
$image->Read('red.tif', 'green.tif', 'blue.tif');
$image->Composite(image=>$image, compose=>'rgb');
$image->Write('composite.tif');
but it just returns grey composite.

Then I tried to compose image from channels using step by step compose=>'Copy/Red/Green/Blue/' and again have only grey composite.

Is there any solution to do RGB composite? (not using command line)
Thanks.

Re: How to combine image from R+G+B channels in Perl?

Posted: 2009-08-28T02:50:15-07:00
by vassapup
This works:
$red->Composite(image=>$green, compose=>'CopyGreen');
$red->Composite(image=>$blue, compose=>'CopyBlue');
(having $red $green $blue as grayscale images, we'll obtain in $red RGB composite)