Trim white space but force image to be square
I have an image that I want to first remove the whitespace and then force the image to be square which may require padding the image.
I've tried using the trim effect and a number of "mode" combinations but no luck. I also tried chained transformations but cannot get the right combination.
Any suggestions are appreciated!
-
Hi Brian,
May I please ask you to share a link to an example image/transformation that you tried? We'll then be able to take a look and suggest ways to achieve that.
Best regards,
Aleksandar
0 -
Here's a sample image.

I'd like to have a square image where the graphic is as large as it can be. In this example, the image is wider than the height so the height needs to be the same as the minimum width. I've cropped the image - here's what I'd like to have in the end:

Thanks again.
0 -
I'm trying to maximize the size of the image while keeping it square.
0 -
Hi Brian,
You can first trim the image and then set the aspect ratio to 1:1 and add lpad if needed. For example:
https://res.cloudinary.com/demo/image/upload/e_trim/c_lpad,ar_1/nice_bird.jpg
If you want, you can upload the logo to your account and try using the `e_trim/c_lpad,ar_1`.
Let me know if that works,
2 -
Thanks Shirly, this worked perfectly!
0
Post is closed for comments.
Comments
5 comments