Resize image canvas to a given w:h ratio

DB
Posted By
David_Blowes
May 17, 2007
Views
1536
Replies
5
Status
Closed
Hi all,

I’ve been trying to work out a way of resizing an image canvas to match a given width:height ratio.

eg, a ratio of 1.25:1, if I give it a file that is 80 * 80, it will pad out the width with white space until the image is 100 * 80

I want to batch process this for completely different size files, so need to work out how to do it automatically within photoshop (rather than manually calculating the size required and simply resizing the canvas).

It would be possible if in the "relative" resize option we could select relative to the other measure (eg, width relative to heigh and vice versa) rather than just relative to itself… Maybe this needs to be in the feature request?

I would have thought this would be reasonably common a need, but I can’t find how to do it!

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

GA
George_Austin
May 17, 2007
David,

Are the initial width and height always equal to each other as in your example? I really don’t think that is your intent but if perhaps it is, use percent for the units of width and height in the canvas size dialog box and enter 125 for width and 100 for height.

George
DB
David_Blowes
May 17, 2007
george,

unfortunately they aren’t… that was just an example. A real life example, one of my images is 100 x 402. In photoshop I can simply change the canvas to 503 x 402, which does the job. However, the next image I do might be 402 x 100, and soo I need to change the height rather than the width…
P
Phosphor
May 17, 2007
Have a look at the following.
<http://www.adobeforums.com/cgi-bin/webx/.3bbf6980>
DB
David_Blowes
May 17, 2007
Excellent, thanks Phos. That will do it for me!

This is how I’ve done it:

1) Save an action that resizes the image to a certain width (eg, 503px in my case)
2) Save an action that resizes the canvas to a certain height (eg 402px)

3) Create a new action submenu, and do the opposite of above (resize the image to a certain height, then resize the canvas to a certain width).

Then using Phos’ above mentioned conditional script automater, you can specify which of the two action subsets to run.

This works for me because my images are LARGER than 503×402 (which is what I’m resizing them to), and because I know that all of them are larger. However, if you have images that were smaller, then it prob wouldn’t work particularly well…

I still think that providing an option in the relative canvas resizing to resize relative to the other measure (height relative to width etc) would be a great feature. Given how photos need to be printed in different ratios, etc it sure would be handy!
B
Bernie
May 17, 2007
Even easier, use "fit image" to resize the image, then use canvas size to add the borders you need

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections