How to batch resize canvas of multiple files placing the original pictures in the centers?

I have got some hundreds of pictures of different shapes. For example one is 600×600, another is 307×600, the third is 600×400, the fourth is 500×300. What I need to turn them all into 600×600 (or 610×610 perhaps to add some reasonable padding) files placing the original pictures into centers of the new pictures (rather than scaling them or placing them near the edges). The only application I know capable of this is Paint.Net but it features (AFAIK) no automation facilities so processing hundreds images is nasty. Any way to do this in batch? Windows and Linux solutions welcome. An opportunity to specify the colour (including an option of PNG empty colour) to fill the canvas space added is highly desirable.

enter image description here


You can do this with actions & the batch automation feature within Photoshop. To accomplish a colored or transparent background with new size dimensions, you’d create an action set (folder icon) and create an action within that set for each color you’re looking to batch.

Step 1: Create the action

Record yourself resizing the canvas for future automation

  • Navigate to the actions panel or Alt+F9
  • Create a new action by clicking the layer icon on the actions panel
  • Do the actions you want automated
  • Click the stop icon on the actions panel

While recording your specific action: (with image open)

  • Go to Image > Canvas Size and change to 610×610
  • Add a square shape for background
  • Change color of shape to desired color / make no background for transparent
  • Move beneath your image

Repeat this, creating a new color action within your action set as desired

Step 2: Setting up a batch automation

Tell Photoshop which folder of images to apply your re-sizing action to

  • Go to File > Automate > Batch
  • ‘Play’ section, choose your newly created action
  • ‘Source’ section, choose a folder of images to apply this action to
  • ‘Destination’ section, choose a folder where the newly re-sized images should output.
  • Click Ok and your automation will begin immediately.

Side Notes:

  • Changing the canvas size will center image within the new dimensions.
  • Custom actions record the things you do in Photoshop, in this case re-sizing.
  • ‘Action Sets’ in the batch dialog are folders or groups of actions in the actions panel.

Source : Link , Question Author : Ivan , Answer Author : im_brian_d

Leave a Comment