macOS sips: Batch Resize Images From the Terminal (the Commands, and a Safe Script)

Batch-resizing massive folders of high-res images can bring your Mac’s graphical apps to a grinding halt. SIPS is a hidden, built-in macOS tool that bypasses the interface entirely to resize thousands of photos in seconds.

macOS sips: Batch Resize Images From the Terminal (the Commands, and a Safe Script)
Text & Photos By David Coleman
Last Revised & Updated:
Filed Under: Photography Gear

I MAY get commissions for purchases made through links in this post.

Have Camera Will Travel // Newsletter

Practical field notes, hands-on gear tests.

Quick Summary

  • The sips command to batch-resize every JPEG in the current folder so its long edge is 1600 pixels is sips -Z 1600 *.jpg — and it overwrites the originals, so run it on copies.
  • sips (Scriptable Image Processing System) is built into every Mac; no install, no app windows, and it can process thousands of files in seconds.

The most useful forms:

JobCommandNotes
Resize so the longest side is 1600 pxsips -Z 1600 *.jpgKeeps aspect ratio; overwrites in place
Set width (height follows)sips --resampleWidth 1200 *.jpgOr --resampleHeight
Write to a new file insteadsips -Z 1600 in.jpg --out resized/in.jpgFolder must exist
JPEG qualitysips -s formatOptions 80 in.jpg --out out.jpg0–100
Convert formatsips -s format png in.jpg --out in.pngjpeg, png, tiff, heic, gif…
Read size/propertiessips -g pixelWidth -g pixelHeight in.jpgNo changes made

The rest of this guide walks through opening Terminal at the right folder, the safe copy-then-resize script, nested folders, and the gotchas.

Macs come with some very useful image editing tools built-in.

Some are obvious, like the default image viewer Preview or the Photos app. But when you’re working with large batches of high-resolution files, graphical applications become a bottleneck. They try to load a visual preview of every single image, which eats up your RAM and slows the process to a crawl.

If you just need to quickly resize a folder of JPEGs for web delivery, there is a much faster way. It relies on a powerful tool hidden right inside macOS called SIPS.

Common questions

Does sips overwrite my originals?

Yes, unless you pass — out to write elsewhere. Duplicate the folder first, or use the safe script below.

Does sips keep EXIF and color profiles?

It keeps embedded metadata and ICC profiles in most cases, but it isn’t an archival tool — check a file if metadata matters, and use ExifTool if you need certainty.

sips says the file is an unrecognized format

It reads what macOS can read (JPEG, PNG, TIFF, HEIC, many RAWs) but won’t write AVIF or WebP; for those use ImageMagick.

What is SIPS?

SIPS stands for Scriptable Image Processing System. It’s a command-line tool that you operate through the Mac’s built-in Terminal app. Because it doesn’t have a graphical user interface (GUI) and doesn’t care about generating thumbnails, it can chew through thousands of images in a fraction of the time it takes standard editing software.

Best of all: it doesn’t require downloading, buying, or installing anything. If you use a Mac, it is already baked into your operating system.

Kayaking in the Arctic

Have Camera Will Travel // Newsletter

Practical field notes, hands-on gear tests, and the fun of exploring the world with a camera in hand.

Here is a step-by-step guide to using SIPS specifically for resizing images.

Step 1: Open Terminal at your folder

Before you type any commands, Terminal needs to know where your images are. The easiest way to do this is to open Terminal directly from the folder containing your files.

  1. Navigate to the folder holding your images in Finder.
  2. Right-click (or CTRL-click) on the folder.
  3. Scroll down and choose Services > New Terminal at Folder.

(If you don’t see this option, you can easily enable it by going to System Settings > Keyboard > Keyboard Shortcuts > Services, and checking the box next to “New Terminal at Folder.”)

Terminal window listing photo files, with the sips -Z 2400 *.jpg command typed at the prompt

Crucial Warning: Work on Copies! The basic SIPS commands are destructive — meaning they will instantly overwrite your original file with the new, smaller version.

There is no “Undo” button in Terminal. Until you’re comfortable with the batching scripts below, always copy your images into a temporary “To Be Resized” folder before running these commands.

The basic commands: Resizing individual images

To keep things simple, here are the core commands for altering a single file.

Set the maximum long edge (maintains aspect ratio)

This is the most useful command. It reduces the longest edge of the photo to your specified pixel count while perfectly maintaining the aspect ratio. It doesn’t matter if the image is vertical or horizontal; SIPS figures it out automatically.

sips -Z 1024 imagefile.jpg
  • Replace 1024 with your desired long-edge pixel dimension.
  • Replace imagefile.jpg with the exact name of your file.

One behavior to know: -Z resizes in both directions. If an image is already smaller than the number you give it, SIPS enlarges it — and upscaled photos come out soft. SIPS has no built-in “only shrink” option, so if your folder mixes large and small images, either sort them first or use ImageMagick, which has a shrink-only resize.

Set width or height explicitly (maintains aspect ratio)

If you are laying out photos in a strict web grid and need them all to be exactly the same width (regardless of how tall they are), use the resample width command:

sips --resampleWidth 800 imagefile.jpg

To strictly set the height instead, use:

sips --resampleHeight 600 imagefile.jpg

Save as a new file (non-destructive)

If you want to keep your original file untouched and save the resized version as a completely new file, simply add the — out tag to the end of your command:

sips -Z 1024 imagefile.jpg --out newimagefile.jpg

Controlling JPEG quality

Every time SIPS saves a JPEG it re-encodes it, and by default it decides the compression level for you. To set it yourself — useful when you’re producing web files and care about size — add the format options flag with a 0 – 100 quality value:

sips -Z 1024 -s format jpeg -s formatOptions 80 imagefile.jpg --out smaller.jpg

Related point: because each save re-encodes, avoid running SIPS repeatedly over the same JPEGs. Resize from the originals in one pass rather than resizing an already-resized copy.

How to batch resize an entire folder

Processing one image at a time defeats the purpose of using Terminal. To process an entire folder, we use a wildcard (*).

For example, if you want to overwrite every single JPEG in your current folder so they all have a long edge of 2400 pixels, you would run:

sips -Z 2400 *.jpg 

The “Safe” batch script

Overwriting original files is risky. The much safer workflow is to tell SIPS to resize the images and dump the new, smaller files into a dedicated subfolder, leaving your originals exactly as they were.

First, create a new folder inside your current directory and name it Resized. Then, run this command:

mkdir Resized
for file in *.jpg; do sips --resampleWidth 1024 "$file" --out "Resized/${file}"; done

This creates a loop. It looks at every .jpg in your folder, resizes the width to 1024px, and saves a copy with the exact same file name directly into your “Resized” folder.

Advanced workflow: Processing nested folders

If you are dealing with a massive archive containing images buried inside various subfolders (like a parent folder with separate folders for “Monday,” “Tuesday,” etc.), you can combine SIPS with the find command to recursively dig through the tree.

If you want to resize all JPEGs across all subdirectories, and you don’t mind overwriting the original files, run this:

find . -iname '*.jpg' -exec sips -Z 1024 {} \;

Here is exactly what that command is doing under the hood:

  • find . – Starts the search in the current directory and drills downward.
  • -iname '*.jpg' – Looks for files with the .jpg extension, regardless of capitalization.
  • -exec – Executes the following command on every file it finds.
  • sips -Z 1024 {} – Runs SIPS to set the long edge to 1024px. The {} acts as a placeholder for the file name.
  • \; – Signifies the end of the loop.

Rebuilding the directory structure

If you want to recursively resize images buried in subfolders without overwriting them, things get a bit more complex. You need a shell script that not only resizes the images but also recreates your entire nested folder structure inside a new “Resized” master folder.

Paste this block into Terminal:

find . -iname '*.jpg' -type f | while read file; do
    newpath="Resized/${file#./}"
    mkdir -p "$(dirname "$newpath")"
    sips --resampleWidth 1024 "$file" --out "$newpath"
done

This script will tirelessly hunt down every JPEG, recreate the exact folder hierarchy inside a new “Resized” folder, and populate it with the smaller images. When dealing with archives of 10,000+ files, letting this script run in the background is exponentially faster than trying to manage the export through a GUI application.

Where SIPS tops out

SIPS is the right tool when the job is resizing and it’s already on every Mac. When you need more — shrink-only resizing for mixed folders, watermarking, contact sheets, format breadth, color-managed conversions — the free ImageMagick picks up where SIPS stops, and ExifTool covers the metadata side. The three work well together.

Found this helpful? Personalize your search results.
Add as Preferred Source