Answer the question
In order to leave comments, you need to log in
When resizing an image with a transparent background using the Imagick class, images with a black background appear. How to fix?
I am resizing a png image with a transparent background in several copies in jpg format. The transparent background is painted black. How to make it white?
Answer the question
In order to leave comments, you need to log in
try like this:
$white=new Imagick();
$white->newImage($width, $height, "white");
$white->compositeimage($image, Imagick::COMPOSITE_OVER, 0, 0);
$white->setImageFormat('jpg');
$white->writeImage('image.jpg');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question