I'm trying to remove the alpha channel (transparency) of a PNG file and replace it with a white background in PHP.
Using ImageMagick I've tried several functions with no luck so far. These are the function which didn't work:
$iMagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_DEACTIVATE);
$iMagick->setImageBackgroundColor('#FFFFFF');
$iMagick = $iMagick->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
Also setBackgroundColor('#FFFFFF')
instead of setImageBackgroundColor('#FFFFFF')
didn't help. Same to replacing '#FFFFFF'
with 'white'
in these 2 functions.
Using ImageMagick 3.4.0RC6 (release date: 2016-11-29) compiled with ImageMagick 6.8.9-9 Q16 x86_64 2016-03-14. Current versions (Ubuntu 16.04).
Any ideas? Thanks in advance
ninsky