Here's the thing.
I hava a simple snippet in PHP like this regarding a transparent image:
$im = new Imagick('some-transparent-image.png');
$im->setImageOpacity(0.3);
$im->writeImage('output.png');
The file output should be a transparent image with lower opacity, right?
Well, the output is an image with black color where it was supposed to be transparent and the image opacity is exactly the same.
Does it have to do with configuration or am i missing something?
Thank you in advance
Unfortunately setImageOpacity affects the whole image, so to leave the transparent areas transparent replace the following:
$im->setImageOpacity(0.3);
with :
$im->evaluateImage(Imagick::EVALUATE_MULTIPLY, 0.3, Imagick::CHANNEL_ALPHA);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With