user3414354
user3414354

Reputation: 301

php imagick image rounded corners black background

        $image = new Imagick($destinationPath.'/'.$filename);
        $image->roundCorners(1575,1575);

I'am uploading different images, one image background is transparent when I make corners rounded, but the other image background is black, why is that? and from what is depending this behaviour?

I've tried to do this:

$img->setBackgroundColor(new ImagickPixel('transparent'));

but the background is still black, someone knows which method can handle this?

Upvotes: 0

Views: 1444

Answers (1)

Serty Oan
Serty Oan

Reputation: 1726

If the source image is a JPEG you need to set final image format to PNG because JPEG does not handle transparency.

$img->setImageFormat('png');

Upvotes: 1

Related Questions