Crop Image to Circle with Transparency
I'm using the following to code to crop an image to circle, 300x300. However, the image obtained have a white background. How can I make it transparent instead of white? and make every image png (because transparency is only supported by PNG)
$image = \Cloudinary\Uploader::upload($_FILES["file"]["tmp_name"],
array(
"width" => "300", "height" => "300",
"crop" => "thumb",
"gravity" => "face",
"radius" => "max"
));
-
Hi Gijo,
Thanks for contacting us.
You can set the `format` to convert the image to the desired format ("format" => "png").
Please let me know if you have any further questions.
Best,
2 -
Thanks :) That worked
0 -
Thanks for the update, glad I could help:)
Feel free to reach out again with further questions or requests always.
Kind regards,
Maor
0
Post is closed for comments.
Comments
3 comments