[magick-users] PerlMagick + Compose + Transparency
Erik Karlsson
pilo at ayeon.org
Sun Jun 1 07:44:34 PDT 2008
Hello.
I am trying to watermark images with a simple text using PerlMagick.
However,
I cannot seem to create a temporary image with true transparency.
Basically,
what I want is to create the watermark as a temporary, transparent
image, and
then overlay it onto the target image.
I create an image using
> $wimage->Read("xc:transparent");
Which yields a transparent image, via
> $wimage->Write("foo.png");
But when trying to overlay it on the target
> $image->Composite(image => $wimage,
> compose => "Over",
> opacity => int($opacity * (2 ** $wimage->Get('depth'))));
the "transparent" background is instead black, but the opacity is in
effect on that black background.
Without opacity, the transparent background is transparent as it should.
Any ideas?
Sincerely,
Erik.
More information about the Magick-users
mailing list