I have a png image with a transparent background and I want to convert it to a jpg image with a white background.
The code is basically this:
$image
Try:
$image = new Imagick('transparent.png'); $image->setImageMatte(true); $image->setImageMatteColor('white'); $image->setImageAlphaChannel(Imagick::ALPHACHANNEL_OPAQUE); $image->writeImage('opaque.jpg');