How to resize images using terminal on Mac OSX?

Marcel picture Marcel · Feb 13, 2015 · Viewed 33.2k times · Source

I need a simple and free way to resize images and do batch jobs, if necessary. Free image manipulation software has been trickier to use than it should be.

Answer

Marcel picture Marcel · Feb 13, 2015

As pointed out by LifeHacker, the following command will do this very easily:

sips -Z 640 *.jpg

To quote their explanation:

"So what's happening? Well, "sips" is the command being used and -Z tells it to maintain the image's aspect ratio. "640" is the maximum height and width to be used and "*.jpg" instructs your computer to downsize every image ending in .jpg. It's really simple and shrinks your images very quickly. Just be sure to make a copy first if you want to preserve their larger size as well."

Source: http://lifehacker.com/5962420/batch-resize-images-quickly-in-the-os-x-terminal