Ads 468x60px

Batch Resize a Group of Pictures from the Command Line with sips

Batch resize group of pictures with sips

Though most Mac users will likely prefer to use Preview to batch resize images because of the ease of use, advanced users often like to go with the command line for repetitive tasks. We've discussed sips before as a way to resize, rotate, and flip images, but if sips is combined with wildcards it can also function as a quick way to batch resize a group of photos.

Launch Terminal from the /Application/Utilities/ folder and use the following syntax:

sips -Z (max height in pixels) /path/to/images/*.(image file extension)

For example, to resize a collection of jpg pictures to each have a max height of 620, located in the desktop folder "ResizeMe":

sips -Z 620 ~/Desktop/ResizeMe/*.jpg

The -Z flag instructs sips to retain the images original aspect ratio while maintaining a maximum height of 620, but you can also specify exact height and width by using a lowercase -z flag instead like so:

sips -z 620 840 *.jpg

The height in pixels is first, followed by the width in pixels.

If the command line doesn't fit well into a workflow, another great option is to batch resize images with an Automator script, which has the added benefit of becoming a self-contained application allowing for standard Finder interactions like drag and drop.

This handy reminder about sips comes to us from Lifehacker