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