PetaPixel

How to Quickly Resize Multiple Photos in Mac OS X Using a Terminal Command

If you use a Mac and regularly need to resize batches of photos, there’s actually a tool built into your operating system that lets you do just that without having to open any image editing program. It’s called “sips”, which stands for scriptable image processing system. It’s extremely easy to use, but you’ll need to know how to use Terminal to take advantage of it.

Simply put copies of all the photos you’d like to resize into a directory, navigate to that directory within Terminal, and run the command:

sips -Z PIXELS *.EXTENSION

Where PIXELS is the maximum number of pixels you’d like the width or height to be, and EXTENSION is the file type you’re working with (e.g. jpg, png, gif).

For example, if you’d like to shrink a large batch of JPEG images down to 620px in width/height, you would run the following command in Terminal (assuming the present working directory contains the files):

sips -Z 620 *.jpg

That’s it. The tool quickly resizes all the images in the directory down. Be aware that this overwrites the original files, so you’ll want to make sure you’re only doing this to copies of photos, not the originals themselves.

To save time, there’s way way to easily open up Terminal in the directory containing the photos you’d like to resize. It’s a right click option that you’ll need to enable: go to System Preferences->Keyboard->Keyboard Shortcuts->Services->Files and Folders and making sure New Terminal at Folder is checked.

Do this, and you’ll see an option for “New Terminal at Folder” when you right click the folder containing your images:

sips can do much more than the simple batch resizing outlined in this post. Check out the command’s manual for all the different functions and options you can use to edit photo files from the comfort of command line (e.g. cropping, editing the color profile, padding, flipping, rotating, etc…).

(via Lifehacker via MacLife)


 
Get the hottest photo stories delivered to your inbox.
Get a daily digest of the latest headlines:
  • http://twitter.com/OliKember Oliver Kember

    Better still just use Automator. Simple Finder based commands, none of that techy code stuff – Resizes jpegs, renames them, all in a simple interface and comes with every Mac. Totally underrated, check it.

  • JosephRT

    Definitely, the Automator has made my life MUCH easier.

  • ninpou_kobanashi

    “Be aware that this overwrites the original files”.

    Shouldn’t this part be in like, bold, red, flashing letters? (^_^)

  • Jonathan

    You can do the same by opening multiple images with Preview, selecting all images, and going to Tools > Adjust Size…

  • Joey

    Use “ThumbsUp”! Its the best, fastest and simplest way to do this: Just drop the pictures on the icon in the dock -> ready.

  • joey

    Ah, and ist free!

  • http://twitter.com/richardford Richard Ford

    Umm – just use automator and be all pointy clicky. Duh! Download heaps of automators from the net too. Double Duh!

  • Jamie MacDonald

    Or make an Automator workflow….Easier for me anyways.

  • http://twitter.com/timobryan Tim O’Bryan

    I regularly batch resize, rename, and convert file type using Automator.

  • Infonautic

    Fine, a simple native alternative for imagemagick in my Gentoo-Prefix. Looks great, many thanks.

  • JoeGjura

    Resizing with Preview is the way to go.

  • James Harrison

    Wish I’d spotted this earlier – Terminal work is a headache… never got the “New Terminal at Folder” option to work… Terminal just returned “*.jpg is not a valid file”.

    Ho-hum – off the user friendly Preview.