Trim photo background
Trim photo background
Social apps
Filters and effects
Presentation
Beginner

Apply the trim filter to remove the edges around the image. Do this by setting the effect parameter to trim (e_trim in URLs). You can customize the color similarity tolerance between 0 and 100. The default level is10`.

Here's an example image: Original

https://res.cloudinary.com/demo/image/upload/business_man_padded.jpg

By enabling the trim effect, we tell Cloudinary to detect and remove image edges whose color is similar to corner pixels: Trimmed

https://res.cloudinary.com/demo/image/upload/e_trim/business_man_padded.jpg

We can customize the color tolerance level to be returned with various results. For example, raising the custom value to 50: Custom level

https://res.cloudinary.com/demo/image/upload/e_trim:50/business_man_padded.jpg

The trim effect works on any color. In addition, you can add parameters to the trim effect to control the tolerance for similar coloring. For example, here's an image in which the default trimming level isn't enough: Default trim

https://res.cloudinary.com/demo/image/upload/e_trim/face_left.jpg

Since the default level is 10, we probably need to raise the tolerance a bit. If we try this again with a higher value (e.g., 20), this seems to deliver the result we need: Custom level

https://res.cloudinary.com/demo/image/upload/e_trim:20/face_left.jpg