How to Use the macOS sips Command to Batch Resize Images in the Terminal

The GUI Bottleneck for Image Processing

Whether you are a web developer optimizing assets for a website, a photographer preparing proofs for a client, or a machine learning engineer formatting a dataset, resizing images is a daily chore.

If you only need to resize one image, opening it in macOS Preview and clicking “Tools > Adjust Size” takes ten seconds. However, if you need to resize 5,000 high-resolution TIFF files down to exactly 800 pixels wide and convert them to JPEGs, using a graphical interface will consume hours of your day and grind your Mac to a halt.

To process massive volumes of images instantly, you must abandon the GUI. macOS includes a deeply powerful, native command-line image processing engine built specifically for this task: the Scriptable Image Processing System, or sips.

Step 1: The Basic Syntax

The sips command acts as a Swiss Army knife for image metadata and manipulation.

Open your Terminal. Let’s start by querying an image rather than changing it. If you want to know the exact dimensions of a file named photo.jpg on your Desktop, use the -g (get) flag followed by the property pixelWidth and pixelHeight.

sips -g pixelWidth -g pixelHeight ~/Desktop/photo.jpg

The terminal will instantly return the exact dimensions without opening any applications.

Step 2: Resizing a Single Image

To resize an image, use the -z (size) flag, followed by the exact height and width you want (in that order).

Warning: sips modifies the file in place by default. It will permanently overwrite your original file. Always make a copy of your images before experimenting.

To resize photo.jpg to exactly 800 pixels high by 600 pixels wide, run:

sips -z 800 600 ~/Desktop/photo.jpg

Step 3: Maintaining Aspect Ratio (Proportional Resizing)

Forcing an image into an exact 800×600 box will squish or stretch it if the original aspect ratio wasn’t a perfect 4:3. Usually, you only care about one dimension (e.g., “Make this image 1200 pixels wide, and let the height be whatever it needs to be to look normal”).

To resize proportionately based on a maximum width, use the --resampleWidth flag.

sips --resampleWidth 1200 ~/Desktop/photo.jpg

To resize based on maximum height, use:

sips --resampleHeight 800 ~/Desktop/photo.jpg

This is the safest and most common way to resize web assets.

Step 4: Format Conversion

Beyond resizing, sips is an incredibly fast format converter. If you have a folder full of massive PNG screenshots and you want to convert them to compressed JPEGs, use the -s format flag.

sips -s format jpeg ~/Desktop/screenshot.png --out ~/Desktop/screenshot.jpg

(Note the use of the --out flag here. When changing formats, you must specify a new output filename, otherwise, sips will create a JPEG file but leave the .png extension on the name, deeply confusing the operating system).

Step 5: The Power of Batch Processing

The true power of sips is realized when combined with the bash wildcard (*).

Let’s put it all together. You have a folder named “Raw” containing 500 massive, 40-megabyte .heic photos from your iPhone. You want to convert them all to JPEGs, resize them so the longest edge is exactly 1080 pixels (perfect for Instagram), and save them into a new folder named “Processed”.

  1. Open Terminal and use cd to navigate into your “Raw” folder.
  2. Create the output directory:
    mkdir Processed
  3. Run the ultimate batch command:
    sips -s format jpeg --resampleHeightWidthMax 1080 *.HEIC --out Processed/

Breaking down the command:

  • -s format jpeg: Converts the Apple HEIC format to standard JPEG.
  • --resampleHeightWidthMax 1080: Looks at every photo. If it’s tall, it makes the height 1080. If it’s wide, it makes the width 1080. It perfectly maintains the aspect ratio.
  • *.HEIC: Applies the command to every single file ending in .HEIC in the current folder.
  • --out Processed/: Saves all the brand-new, tiny, perfectly formatted JPEGs into the new folder, leaving your original 40MB files completely untouched.

macOS will chew through hundreds of images in seconds, completely silently in the background, proving that the terminal is vastly superior to the GUI for repetitive media tasks.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.