This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

Increase Background Dimensions

Comments

3 comments

  • Avatar
    Tia Esguerra

    Hi Patrick, 

    Thanks for reaching out. 

    Yes, you can do this by using the c_pad transformation. What this does is resize the image to the dimensions you specify, keeping all parts of that image visible ( nothing is cropped out ). If the aspect ratio of the original image is not the same as the aspect ratio of the dimensions you specified, padding will be added. The padding will be white by default. 

    You can see the original sample image here, where the aspect ratio is 3:2
    https://res.cloudinary.com/demo/image/upload/sample.jpg

    And you can see here that I have asked for the image to be a square -  1:1 aspect ratio, by including the c_pad transformation
    https://res.cloudinary.com/demo/image/upload/c_pad,h_300,w_300/sample.jpg 

    You can reference our documentation on the c_pad transformation here: https://cloudinary.com/documentation/transformation_reference#c_pad 

    I hope this helps. Let me know if you have any questions. 

    Kind Regards, 

    Tia

    0
    Comment actions Permalink
  • Avatar
    Patrick Hyde

    Hi Tia,

    Thank you, this worked for me! 

    0
    Comment actions Permalink
  • Avatar
    Kate Breish

    @Tia Esguerra Hi!  Our company is running into the same issue, but we are working with images that do not have pure white backgrounds.  Is it possible for a content-aware fill to be added when increasing the background of an image to make it 1:1?  Also is it possible for a code to be written so that, in automating this process when downloading, that it could ignore files with "DE" in them and instead crop into those?  We are not equipped to write this coding ourselves, would your coders be able to create something custom for us?

    Thanks in advance!

    Kate

    0
    Comment actions Permalink

Post is closed for comments.