Skip to main content
Participant
August 27, 2013
Question

Canvas based on specfic ratio aspect

  • August 27, 2013
  • 1 reply
  • 476 views

Hi all,

I have a lot of images in different sizes.

These images need to be canvased based on width 400px and height 300px.

Please not that I don't want to resize the images (they can be of any size), but only canvas them, so that they all have the same ratio aspect.

If I later on resize them, the proportions should always be 400 x 300px.

Kind regards,

Kim

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
August 27, 2013

If any image is larger then 400px by 300 px they must be resampled down in size or they would get cropped to 400x300px.

It is very easy to resize images larger the 400x300 and leave smaller image as they are. The hard part is orientation. Ideally you would use the Adobe Plug-in Fit Image and set the area to 400 wide and 300 high and set the do not resize up in size.  However you would first want to rotate images that are portraits to landscape, resize and add canvas so any image with less the 400px by 300px will have canvas added. Then rotate the image that were portraits back to portraits.

If you download my crafting action package it contains a script I wrote to be used in actions twice named orient.jsx.  This script will look at the document orientation (portrait vs landscape)  On the first execution, if the document is a portrait, it will be rotated  to a horizontal.

On the second execution, a rotated document will be restored to a vertical. This effectively toggles the orientation ONLY if  the original document started out as a portrait.

So it would be very east to record and action and batch it to do what you want

Action

Step 1 menu File>Scripts>orient

Step 2 menu File>Automate>Fit Image... In the dialog set width 400 Height 300 check don't enlarge.

Step 3 menu Image>Canvas Size in the dialog set set width 400px and Height 300 px do no check relative and leave anchor point centered

Step 4 menu File>Scripts>orient

Note: Image must have a background layer so any added canvas will receive background color pixels and not be empty transparent area.. If you unsure if there is a background layer my crafting action package contains a script  for actions  that will select the background layer if there is none one will be added.

http://www.mouseprints.net/old/dpr/orient.jsx

Message was edited by: JJMack

JJMack