Tuesday 23 January 2018

How to set background color into transparent image Imagick PHP

ini_set('display_errors',1);
header('Content-type: image/png');
$strInputFile = 'front.png'; // transparent image
$im = new Imagick($strInputFile);
$im->setImageBackgroundColor('green');
$im = $im->flattenImages();
echo $im;exit;

No comments:

Post a Comment