May 12, 2015
This OS X command line tool is very handy. Every time I need it though I have to google it to remember what it’s called. So, I’m making a blog post to remind myself. Hopefully it will be useful to others who happen across this post.
> sips -Z 200 *.jpg
The -Z tells to utility to maintain aspect ratio
The 200 can be changed to any maximum height/width (in pixels)
The *.jpg tells the utility to resize all jpg files in the current directory. This can be changed to *.png, *.gif, etc.
You can also change the format of a folder of images by running the following command:
> for i in *.jpg; do sips -s format png $i –out $i.png;done
This would convert all jpg images to png.