Skip to main content



  • Itay Taragano

    Hi Christopher, 

    Cloudinary supports trimming white space around images using the 'trim' effect ( e_trim ).

    Here's an image example:,h_200,c_crop,g_face/face_top.jpg,h_200,c_crop,g_face/face_top.jpg

    And here's the same image using the 'trim' effect:,h_200,c_crop,g_face/e_trim/face_top.jpg,h_200,c_crop,g_face/e_trim/face_top.jpg

  • Christopher O'Connor


    Where is the documentation for e_trim, I can't find it?

    Is it only for white color?

  • Itay Taragano

    The 'trim' effect is a new feature that isn't documented yet, we're working hard on updating and improving our documentation.

    The 'trim' effect will work on any color, it's using the background color of the corners of the image. In addition, you can add parameters to the 'trim' effect in order to control the tolerance for similar coloring (e.g., e_trim:40 ).

    For example, here's an image:


    Since the background isn't a solid color, the 'trim' effect won't make a difference:


    Setting the tolerance parameter to 20 (Default is 10) will make the difference:

  • Dayson Pais

    How can I use e_trim in the PHP and jQuery libraries?

  • Itay Taragano

    Hi Dayson, 

    Here are sample codes to deliver an image using the trim effect:

    In PHP:

    <?php echo cl_image_tag("sample.jpg", array("effect" => "trim")); ?>

    In jQuery:

    $.cloudinary.image("sample.jpg", { effect: "trim" });

  • Pulkit Singhal

    Is it possible to give weights for top,bottom,left, right? Like e:trim:20:20:20:40

  • Itay Taragano

    Thank you for your suggestion.

    While this is on our road-map to support in the future, there's no ETA yet.

  • Mordy Tikotzky

    Is there a way to trim but leave some padding.

    For example if an image has an extra 50px on each side. I would like to trim but leave 20px of space around the image.

  • Itay Taragano

    You can accomplish that by adding a white border to the image, for example:,h_200,c_crop,g_face/e_trim/bo_20px_solid_white/face_top.jpg

    For more information:

  • Mordy Tikotzky

    Thanks Itay,  My Problem is that I have some photos with whitespace and some without.

    What I'm trying to accomplish is that if a photo has whitespace then I want to trim the whitespace to 20px, but if the image does not currently have any whitespace then I dont want to add any additional whitespace. Is there anyway for me to accomplish that using cloudinary.

  • Matt Zisow

    I'm having the same problem. I'd like to trim out white space but make sure that it leaves at least a set number of pixels on each side of the object.


Post is closed for comments.