Immediately resize, rotate, and flip images via the command line
You can resize, rotate, or flip any image file via the Mac’s Terminal using the command line sips tool. Manipulating images with sips is practically instantaneous, if you need to quickly resize, rotate, or flip an image file it definitely beats firing up Preview.
Resizing an image from Terminal
You can resize any image with sips using the following syntax:
sips -z 600 800 test.jpg The format is height first then width, so despite the command appearing dimensionally backwards to many computer users, the above command would resize an image to be 800 pixels wide by 600 high.
Rotating images from the Terminal
By default, sips rotates clockwise so you just need to specify the degrees you want an image rotated, like so:
sips -r 90 image.jpg The file will immediately be rotated 90 degrees clockwise.
Flip an image from the Terminal
Using sips, you can also flip any image vertically or horizontally from the command line, here’s an example:
sips -f horizontal image.jpg This will instantly flip image.jpg horizontally, you can just as easily flip the image vertically by replacing horizontal with vertical like so:
sips -f vertical image.jpg

Hey,
Do you know if there is a way to specify JPEG quality with sips? With the orientation example this shouldn’t matter as it is possible to change the orientation of a JPEG (I think in Exif rather than JFIF JPEGS?) via metadata so the image data is not recompressed, but I am intrigued to know what sips setting is for uncompressed (say TIFF) to JPEG?
I can’t find it in the man page!
is there a way to run sips from command line quietly ie no messages?
You could just send the output to /dev/null:
sips -z 600 800 test.jpg > /dev/null
Does sips open .eps images? Any alternative from command line to change the resolution of a .eps image? Thanks
Using this method… is there a way to batch resize images by percentage? ie… resize to 50% of the original size instead of having to specify the resolution.
[...] it still handles batch processing bulk photos just fine. Also, you can tweak and resize images from the command line tool sips, which requires usage of the Terminal and thus may be considered more advanced, but it can be [...]