Batch-Resizing images in OS X to a certain height

Solution 1:

You can also batch-resize images from Preview:

Or 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 x60 -quality 93 ${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

Solution 2:

Use (install) the Action "Save for Web" available in http://junecloud.com/software/mac/junecloud-automator-actions.html.

Worked for me :).

You can specify a maximum with and Height for the image.