I have got some hundreds of pictures of different shapes. For example one is 600x600, another is 307x600, the third is 600x400, the fourth is 500x300. What I need to turn them all into 600x600 (or 610x610 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.
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
While recording your specific action: (with image open)
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
I have received a perfect answer at another (non-English) site, let me publish it here for those who may have the same question in future.
mogrify -extent 640x640 -gravity Center -fill white *.jpg
mogrify command is a part of ImageMagick)