php imagick图像圆角黑色背景

        $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?

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');