Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anybody know of a tool that can resize an image and automatically center it on it's new dimension?

Example, I have a 200x300 image, I wanted to resize it to 300x300 putting whitespace of 50px on both the right and left sides.

I'm using FastStone Photo Resizer, it works as I wanted including resizing multiple folders at once but it doesn't have that "auto-center" capability.

share|improve this question

closed as off-topic by Excellll, Nifle, mdpc, fixer1234, Raystafarian Apr 26 '15 at 11:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – Excellll, Nifle, mdpc, fixer1234, Raystafarian
If this question can be reworded to fit the rules in the help center, please edit the question.

What OS are you on, that may be helpful to get answers. – nerdwaller Nov 26 '12 at 23:42

You can do that (and much more) with ImageMagick. With ImageMagick installed, type this on your command line / shell (replace arguments to your need):

 convert input.jpg -resize 80x80 -size 80x80 \
    xc:blue +swap -gravity center -composite output.jpg

This resizes the image to fit within a "canvas" of 80x80 pixels, centers the image and fills the background blue (blue was only chosen as an example).

ImageMagick is available for several (most?) OSes.

Folder processing

If you're working in Unix-like environment (Linux, BSD etc - even Mac), you can execute the aforementioned command through find, which enables you to process folders etc:

find /path/to/my/folder -iname "*.jpg" -exec \
    convert {} -resize 80x80 -size 80x80 \
    xc:blue +swap -gravity center -composite {}_resized.jpg \;
share|improve this answer

There is a commandline tool primary intended on batchjobs for complete folders.

scaling images
bumscaleimage [sourcefile] [destfile] [width] [height] [quality] [withoutBorders] [backgroundcolor]
 [sourcefile]   JPG oder Bitamp
 [destfile]     JPG oder Bitamp (Pfad muss nicht existieren)
 [width] in pixels
 [height] in pixels
 [quality] optional default=92 for jpg
 [withoutBorders] optional default=1 0 for borders
    without borders means set possibly only high OR width will be reached
 [backgroundcolor] optional default=$ffffff im angegebenen Format

[sourcefile] also can be used with folder\*.ext , destination than has to be a folder

C:\Bilder\Noemi\DSCF0001.JPG C:\test.jpg 100 100 92 0 $ff0000
C:\Bilder\Noemi\*.JPG C:\Zielverzeichnis 100 100 92 0 $ff0000

Freeware for non comercial use
share|improve this answer

CropSize may be an option, it has this feature and many more...

share|improve this answer
Can you include some of the details from that post in your answer? Just providing links is discouraged, see the FAQ( – slm Mar 27 '13 at 1:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.