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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
vassapup

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

Post 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.
Last edited by vassapup on 2009-08-28T02:50:50-07:00, edited 1 time in total.
vassapup

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

Post 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)
Post Reply