Increase Background Dimensions

Comments

2 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

Please sign in to leave a comment.