setBackgroundColor('white'); // apply changes to image $image->flattenImages(); // output the modified image header('Content-Type: image/jpeg'); echo $image; ?>
php -m | grep imagickIf you see "imagick" in the list of installed modules, then you're good to go! If not, you'll need to install the Imagick PHP extension before you can use the library in your code.