sips: macOS Hidden Image Swiss Knife
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
| Flag | What It Does | Example |
|---|---|---|
-g key | Get a property | sips -g pixelWidth img.png |
-Z maxSize | Resize preserving ratio | sips -Z 1200 *.png |
-z h w | Resize to exact dimensions | sips -z 630 1200 img.png |
-s format | Convert format | sips -s format jpeg img.png --out img.jpg |
-r degrees | Rotate | sips -r 90 img.png |
-f direction | Flip | sips -f horizontal img.png |
-c h w | Crop to dimensions | sips -c 630 1200 img.png |
--out | Write to file/dir | sips -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
sipsships with every Mac. Zero install, zero dependencies-Zis the everyday workhorse: one flag, aspect-ratio-safe resizing- Without
--out,sipsmodifies files in place. Add--outto 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 sipson 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.