Hello,
I am trying to create a synthetic image with PerlMagick.
I just do not know how to create an alpha channel (8 bit) to the image.
I tried the following code (see below).
It works without any error message.
But the resulting image looks just plain opaque.
Any help would be highly appreciated
Richard
#######################################
my $image=Image::Magick->new;
$image->Set(size=>'100x100');
$image->ReadImage('xc:#0000ff');
$image->Set('matte' => 'True');
my $mask = Image::Magick->new ();
$mask->Set(size=>'100x100', depth=>8);
for ( my $runnerX = 40; $runnerX < 60; $runnerX++ )
{
for ( my $runnerY = 40; $runnerY < 60; $runnerY ++ )
{
$mask->Set("index[$runnerX, $runnerY]"=>127); # which value would be
senseful?
# $mask->Set("pixel[$runnerX, $runnerY]"=>'#888'); # does also not work
}
}
$image->Composite(image=>$mask, compose=>'CopyOpacity');
$image->Write(filename=>'../PerlMagicTest.png');
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users