I wrote a script to watermark images. On command line adding watermark works fine:
composite -dissolve 5% -gravity South watermark.png original.jpg new.jpg
Now when I tried to use Perlmagick for watermarking, the composite part does not change anything:
my $i = new Image::Magick;
my $watermark = $i->Read( "watermark.png" );
my $i2 = new Image::Magick;
my $p = $i->Read( "original.jpg" );
$i->Set( Gravity => 'Center' );
$i->Resize( geometry => "600x600" );
$i->Composite( image=>$watermark, compose=>"Dissolve", opacity=>5, gravity=>"South" );
$i->Write( 'jpg:temp_file' );
Such script resizes image, but does not watermark it.
Problem seems to be in the way I provide dissolving degree. On command line I can add percentage to dissolve-attribute, but in API version dissolve is itself attribute. I tried with opacity, but this seems not the right way too.
What is the right way to use dissolve in Perlmagick?
Edit: Images I use
new (result of command composite -dissolve 5% -gravity South watermark.png original.jpg new.jpg)
I tried the following:
It gives me:
So you can see the watermark has been composed into the original. So maybe the
opacityparameter can be used like this?