[magick-users] Setting the alpha channel and compositing images

Dave Drinkle ddrinkle at digital-assets.net
Mon Jul 10 13:11:42 PDT 2006


Hi,
    I'm trying to create a image by compositing two images together using
PerlMagick.  The top image I want to be semi-transparent, so the image in
the back is visible through it.  I am completely lost as to how to do it.
I've tried a few things, but nothing works.. I'm sure I'm making it more
difficult than it should be.

Any help would be greatly appreciated.

Here's an example of what I've tried...


my $image1 = Image::Magick->new();
my $image2 = Image::Magick->new();
$image1->Read($ARGV[0]);
$image2->Read($ARGV[1]);
$image1->Composite(image=> $image2, compose => "blend",opacity => 25);

$image->Write("newimage.png");


Dave




More information about the Magick-users mailing list