I've been batch-resizing images through Preview (OS X) through the menu bar, but I want a simpler workflow, since I do this a dozen times a day.

What I want:

  1. Select a group of image files in finder
  2. Hit a button or two (menu item or keyboard shortcut) to do the following:
    • Scale all the pictures to 600 pixels wide
    • Save as JPG files at 75% quality

What I also want:

  • All of the above, plus step a(1): Crop images to 200 pixel height

I can do all that manually, to a batch of files, through Preview. I can do it one at a time with some keyboard shortcuts in Photoshop or Pixelmator.

Automator (using Preview) can scale to 600 pixels on the longest dimension, but it doesn't let me specify width. (It can scale specifically to width before cropping height.) It can change to JPG, but it can't specify image quality. I also can't assign a keyboard shortcut to the whole process.

Is that my best option on a Mac? Can I accomplish this more efficiently through another app like Quicksilver?


You can install ImageMagick with brew install imagemagick or sudo port install imagemagick and use something like this:

for f in *.png; do convert $f -filter lanczos2 -resize 600x -extent 600x200 -quality 75 ${f%png}jpg; done

More examples:

# modify images in place and make images larger than 1280x1280 pixels smaller
mogrify -filter lanczos2 -resize '1280x1280>' *.png

# save thumbnails to ~/Desktop and make images wider than 500 pixels smaller
mogrify -filter lanczos2 -thumbnail 'x500>' -format jpg -quality 93 -path ~/Desktop/ *.png

# make images smaller or larger and crop them so that they are exactly 200x200 pixels
-resize 200x200^ -extent 200x200 -gravity center

# use a white instead of a black background
convert transparent-bg.png -flatten white-bg.jpg

The default filter for downscaling images is Triangle, which often makes images look too blurry without additional sharpening in my opinion. Triangle is similar to the resizing methods used by Automator and sips. I usually use Lanczos2 (2-lobe Lanczos), which makes images less sharp than Lanczos (Lanczos3 or 3-lobe Lanczos). Lanczos2 is almost identical to Catrom, and it is also similar to the bicubic option in Photoshop.

A comparison of different resizing options: http://lri.me/upload/imagemagick-osx-resizing/index.html

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