sips: macOS Hidden Image Swiss Knife

· 2 min read ·
·
macOS CLI Productivity

Today I discovered sips (Scriptable Image Processing System) has been shipping with macOS since Panther (10.3) and I’ve been opening Preview like a caveman this whole time.

I was copying research paper images into a blog post and needed to check dimensions, batch resize, and convert formats. Instead of opening each file in Preview, I ran one command and got instant results.

The Commands That Replaced My GUI Habit

# Check dimensions of all images
sips -g pixelWidth -g pixelHeight *.png

# Resize all PNGs to max 1200px (preserves aspect ratio)
sips -Z 1200 *.png

# Convert PNG to JPEG with quality 80
sips -s format jpeg -s formatOptions 80 image.png --out image.jpg

# Resize and output to a separate directory (originals untouched)
mkdir -p resized
sips -Z 1200 *.png --out resized/

# Rotate 90 degrees
sips -r 90 screenshot.png

# Flip horizontally
sips -f horizontal image.jpg

The -Z flag is the one I use most. It scales down to fit within a maximum pixel dimension while preserving aspect ratio. No math required.

Quick Reference

FlagWhat It DoesExample
-g keyGet a propertysips -g pixelWidth img.png
-Z maxSizeResize preserving ratiosips -Z 1200 *.png
-z h wResize to exact dimensionssips -z 630 1200 img.png
-s formatConvert formatsips -s format jpeg img.png --out img.jpg
-r degreesRotatesips -r 90 img.png
-f directionFlipsips -f horizontal img.png
-c h wCrop to dimensionssips -c 630 1200 img.png
--outWrite to file/dirsips -Z 800 *.png --out small/

Where I Use It Now

Blog image pipeline. Before committing images to my portfolio repo, I normalize everything to 1200px max width:

find public/images -type f -name "*.png" -print0 | \
  xargs -0 -I{} sips -Z 1200 "{}"

Quick format conversion. When a tool spits out WebP or TIFF and I need PNG:

sips -s format png screenshot.webp --out screenshot.png

Dimension checks. Before writing image markup, confirm the actual size:

sips -g pixelWidth -g pixelHeight public/images/og-*.png

What I Learned

  • sips ships with every Mac. Zero install, zero dependencies
  • -Z is the everyday workhorse: one flag, aspect-ratio-safe resizing
  • Without --out, sips modifies files in place. Add --out to preserve originals
  • Supports JPEG, PNG, TIFF, GIF, BMP, PSD, PDF, and WebP
  • For anything beyond resize/crop/convert (compositing, text overlays, filters), reach for ImageMagick instead
  • man sips on macOS has the full property and format list

Found a CLI tool hiding in plain sight on your machine? I’d love to hear about it. Reach out on LinkedIn.