Composition of alpha channels fails on 6.9.1-2
Posted: 2017-10-18T02:08:34-07:00
Hello.
I have this PHP code (simplified):
It loads logo and places it to partictly transparent background image. On localhost it produces expected result, but on hosting it fails.
Logo:

Expected result:

Current result:

Localhost
imagick module version: 3.4.3
Imagick compiled with ImageMagick version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-12
Imagick using ImageMagick library version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-12
Hosting
imagick module version: 3.4.3RC1
Imagick compiled with ImageMagick version: ImageMagick 6.9.1-2 Q16 x86_64 2015-05-21
Imagick using ImageMagick library version: ImageMagick 6.9.1-2 Q16 x86_64 2015-05-21
I think it is bug in ImageMagick 6.9.1-2.
Any idea how to fix it? I can't update ImageMagick to newer version because hosting is not mine
Many thanks for help!
---
Maybe same problem: https://www.imagemagick.org/discourse-s ... hp?t=27683
I have this PHP code (simplified):
Code: Select all
$back = new Imagick;
$back->newImage(400, 400, new ImagickPixel('#FFEEEEBB'));
$back->setColorSpace(Imagick::COLORSPACE_SRGB);
$back->setOption('png:color-type', 6);
$back->setImageFormat('png32');
$scale = 0.45;
$front = new Imagick;
$front->setBackgroundColor(new ImagickPixel('transparent'));
$front->readImage(__DIR__ . '/source.png');
$front->transformImageColorspace(Imagick::COLORSPACE_SRGB);
$front->setImageFormat('png32');
$front->resizeImage($front->getImageWidth() * $scale, $front->getImageHeight() * $scale, Imagick::FILTER_LANCZOS, 1, 0);
$back->compositeImage($front, Imagick::COMPOSITE_DEFAULT, 50, 50);
Logo:

Expected result:

Current result:

Localhost
imagick module version: 3.4.3
Imagick compiled with ImageMagick version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-12
Imagick using ImageMagick library version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-12
Hosting
imagick module version: 3.4.3RC1
Imagick compiled with ImageMagick version: ImageMagick 6.9.1-2 Q16 x86_64 2015-05-21
Imagick using ImageMagick library version: ImageMagick 6.9.1-2 Q16 x86_64 2015-05-21
I think it is bug in ImageMagick 6.9.1-2.
Any idea how to fix it? I can't update ImageMagick to newer version because hosting is not mine

Many thanks for help!
---
Maybe same problem: https://www.imagemagick.org/discourse-s ... hp?t=27683