Resizing Files Quickly with OS X
So you’ve got 60,000 4K frames that someone needs resized to 2K. It will take an eternity to do it with Photoshop, even with a batch action. Fortunately, hidden within Mac OS X is a much faster utility, and it will take care of every file in a folder with just one line of code. (Or three, depending on how you count.)
It’s called SIPS (“Scriptable Image Processing System”), and it’s built in to every Mac OS since (I think) OS X 10.3. If you’re not familiar with the Terminal in OS X, it will take a little bit of study and practice to get it. You should at least be familiar with the Terminal commands cd
and ls
, and navigating folders with these commands, before proceeding.
If you were just going to use SIPS to convert the size of a single image, you might issue a command like this, having first used cd
to navigate to the folder containing the image:
$ sips --resampleWidth 2048 bigfile.png --out smallfile.png
(Don’t type the $ at the beginning of the line!)
Try it out on a file, substituting the names of the input file bigfile.png and the output file smallfile.png for names of your choosing, and substituting the output size 2048 for whatever you like.
Things get a little more interesting if you want to do a whole bunch of files at once. We’ll have to issue a SIPS command for every file in the folder:
$ for i in *.png; do sips --resampleWidth 2048 $i --out Converted;done
With this code, SIPS will run once for each file ending in .png found in the current folder, and save a resized copy into a folder called Converted (which in this case, you will have to have created within the current folder).
Give it a shot, and you’ll be amazed at how quickly SIPS can churn through files.
You can specify the input and output folders without having to navigate with cd
:
$ for i in /path/to/inputfolder/*.png; do sips --resampleWidth 2048 $i --out /path/to/outputfolder;done
What are the paths to the folders? Try navigating with cd
to the folder you want and type pwd
. Or, if you’re feeling like a cool trick, drag the folder icon in the title bar of a Finder window, and drop it into the Terminal window. Terminal will instantly type for you the proper path of the folder opened in that Finder window. Clever!
You can also use SIPS to convert file formats, but I’ll let this article cover that. Don’t miss the comments for a useful tip.
I’m not sure how clearly I wrote this, so if stuff isn’t making sense, please shout at me in the comments and I’ll do my best to clarify. Always have a backup before you experiment and mess with your precious files!
Thank you so much! I am OS X User since the very first release in 2001 and use the Terminal quite often but did not know about this as I always used Graphic Converter for such tasks. But sips is even better for this specific task. Another reason to integrate OS X into my Fulldome production pipeline.