Skip to main content
Participant
February 27, 2023
Question

How to batch equal canvas size increase on non-square images

  • February 27, 2023
  • 3 replies
  • 2061 views

I regularly need to input a 10%-20% increase in canvas width (or height) with images that aren't perfect squares, yet keep a consistent white border. For instance, I want to batch-process 100 images with varied ratios. I need the same pixel dimensions on all sides after specifying a percentage on one dimension. The only way I can do this is by noting down the horizontal dimension in pixels, adding 10% to the canvas size, then subtracting the original horizontal dimensions from the larger new horizontal dimensions. The resulting number I then need to add to the vertical dimensions. Sounds complicated, but actually a simple and necessary action to give an equal white border on many images with different image ratios. Surely there's a way to batch. Any help on this?

This topic has been closed for replies.

3 replies

Participant
February 27, 2023

Thanks, I'll check them out! 🙂

Trevor.Dennis
Community Expert
Community Expert
February 27, 2023

Keeping the same horizontal and vertical addition to canvas size might be problematic.  There is no problem doing the one with an action.  Set the rulers to Percentage to record the action.  You can see that using Percent for the other axis will result in a different pixel size with a non square aspect ratio.  So it might be down to using a script.

 

@Stephen Marsh  is one of the forum scripting experts.

Participant
February 27, 2023

You're right, I think a script is the way to go! I'll look in to that, thanks 🙂

Inspiring
February 27, 2023

It sounds like this can be done using an action.

 

Could you provide a couple of before & after examples? This would make it a lot easier to understand and the answers you get will be a lot better.

 

Participant
February 27, 2023

Thanks, I think I've worked it out now 🙂