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

hakre
  • 193,403
  • 52
  • 435
  • 836
user3414354
  • 291
  • 7
  • 20
  • try this solution --- http://stackoverflow.com/questions/13579272/php-imagick-add-round-corners-to-a-jpeg-file – Tasos Mar 31 '14 at 17:10
  • possible duplicate of [php imagick rounded corners with transparent background](http://stackoverflow.com/questions/22766178/php-imagick-rounded-corners-with-transparent-background) – Danack Apr 01 '14 at 22:57
  • Please don't make duplicate questions. Please edit your original question to be better if it gets downvotes. – Danack Apr 01 '14 at 22:57

1 Answers1

1

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');
Serty Oan
  • 1,737
  • 12
  • 19