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 this one:
$white->newImage($image->getImageWidth(), $image->getImageHeight(), "transparent");