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.
Is there any solution to do such a composite? (not using command line)
Thanks.
(done) How to combine image from R+G+B channels in Perl?
(done) How to combine image from R+G+B channels in Perl?
Last edited by vassapup on 2009-08-28T02:49:16-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to combine image from R+G+B channels in Perl?
try posting to the PerlMagick forum viewforum.php?f=7
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: How to combine image from R+G+B channels in Perl?
On the command line you would use the -combine operator and with MagickWand it would be MagickCombineImages but I can't find an equivalent operation in the docs for PerlMagick.
Pete
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: How to combine image from R+G+B channels in Perl?
Thanks!
I posted this question in perl-forum topic
If there won't be any perl-solution, I'll just call Imagemagick in commandline from Perl.
I posted this question in perl-forum topic
If there won't be any perl-solution, I'll just call Imagemagick in commandline from Perl.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to combine image from R+G+B channels in Perl?
If you can't find a Combine method in perl, put a notice on the bugs forum and Cristy may add one.
In the mean time their is a composite solution. You take a red channel image
and use the CopyGreen and CopyBlue compose operators to copy those channels from the respective channel images.
A Command line equivalent is shown on
http://www.imagemagick.org/Usage/channels/#combine
But for non-RGB images. RGB images are easier, with one channle (typicaly red) regarded as already in place.
In the mean time their is a composite solution. You take a red channel image
and use the CopyGreen and CopyBlue compose operators to copy those channels from the respective channel images.
A Command line equivalent is shown on
http://www.imagemagick.org/Usage/channels/#combine
But for non-RGB images. RGB images are easier, with one channle (typicaly red) regarded as already in place.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to combine image from R+G+B channels in Perl?
Yes! This perl-equivalent works:anthony wrote:You take a red channel image
and use the CopyGreen and CopyBlue compose operators to copy those channels from the respective channel images.
$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)