Transparent to white in Imagick for PHP

后端 未结 10 1645
暗喜
暗喜 2020-12-16 11:58

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          


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 12:26

    $image = new Imagick('transparent.pdf');
    $image->setImageType (imagick::IMGTYPE_TRUECOLOR);
    $image->writeImage('opaque.tif');
    

    did for me!

    (instead of the formerly imagick::IMGTYPE_TRUECOLORMATTE)

提交回复
热议问题