# sips — Resize and Convert Images

> Practical guide to sips — resize, convert, rotate and query images right in the macOS terminal, ideal for batch processing without extra software.

Source: https://www.jpkc.com/db/en/cheatsheets/macos/sips/

<!-- PROSE:intro -->
sips (Scriptable Image Processing System) is the image tool built right into macOS: you resize, convert and edit images directly from the terminal — with no extra software to install. It reads and writes JPEG, PNG, TIFF, GIF, BMP, HEIC and more, queries properties like dimensions and DPI, and — thanks to wildcards and shell loops — is ideal for batch-processing entire folders. This guide walks you through the commands you reach for daily, from pulling image info to mass-resizing.

Important: without `--out`, sips works **in place** and **overwrites the original** irreversibly. Work on copies, or always pass a separate target with `--out`.
<!-- PROSE:intro:end -->

## Image Info

`sips -g all <image>` — Show all properties of an image.

```bash
sips -g all photo.jpg
```

`sips -g pixelWidth -g pixelHeight <image>` — Show the dimensions of an image.

```bash
sips -g pixelWidth -g pixelHeight photo.png
```

`sips -g format <image>` — Show the image format.

```bash
sips -g format photo.heic
```

`sips -g dpiWidth -g dpiHeight <image>` — Show the DPI (resolution) of an image.

```bash
sips -g dpiWidth -g dpiHeight print.tiff
```

## Resize

`sips -Z <maxpx> <image>` — Resize image to fit within a maximum dimension (preserves aspect ratio).

```bash
sips -Z 1024 photo.jpg
```

`sips -z <height> <width> <image>` — Resize to exact dimensions (may distort).

```bash
sips -z 600 800 photo.jpg
```

`sips --resampleWidth <width> <image>` — Resize by width only (preserves aspect ratio).

```bash
sips --resampleWidth 1920 photo.jpg
```

`sips --resampleHeight <height> <image>` — Resize by height only (preserves aspect ratio).

```bash
sips --resampleHeight 1080 photo.jpg
```

## Convert Format

`sips -s format <format> <image> --out <output>` — Convert image to a different format.

```bash
sips -s format png photo.jpg --out photo.png
```

`sips -s format jpeg <image> --out <output>` — Convert to JPEG.

```bash
sips -s format jpeg screenshot.png --out screenshot.jpg
```

`sips -s format heic <image> --out <output>` — Convert to HEIC (smaller file size).

```bash
sips -s format heic photo.jpg --out photo.heic
```

`sips -s format pdf <image> --out <output>` — Convert an image to PDF.

```bash
sips -s format pdf scan.png --out scan.pdf
```

`sips -s formatOptions <quality> <image>` — Set JPEG quality (0-100, low=small file).

```bash
sips -s format jpeg -s formatOptions 80 photo.png --out photo.jpg
```

## Transform

`sips -r <degrees> <image>` — Rotate an image clockwise by degrees.

```bash
sips -r 90 photo.jpg
```

`sips -f horizontal <image>` — Flip an image horizontally.

```bash
sips -f horizontal photo.jpg
```

`sips -f vertical <image>` — Flip an image vertically.

```bash
sips -f vertical photo.jpg
```

`sips -c <height> <width> <image>` — Crop image to specified dimensions (from center).

```bash
sips -c 1080 1080 photo.jpg
```

`sips -p <height> <width> <image>` — Pad image to specified dimensions (adds whitespace).

```bash
sips -p 2000 2000 photo.jpg
```

## Batch Processing

`sips -Z <maxpx> *.jpg` — Resize all JPEG images in the current directory.

```bash
sips -Z 1024 *.jpg
```

`for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done` — Convert all HEIC files to JPEG.

```bash
for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done
```

`sips -Z 800 --out <dir> *.png` — Resize all PNGs and save to a different directory.

```bash
sips -Z 800 --out thumbnails/ *.png
```

`sips -g pixelWidth -g pixelHeight *.jpg` — Show dimensions of all JPEG images.

```bash
sips -g pixelWidth -g pixelHeight *.jpg
```

<!-- PROSE:outro -->
## Conclusion

sips is a surprisingly capable tool that ships preinstalled on every Mac — perfect for quick conversions, thumbnails, or scripting the automated prep of entire image folders. Always remember that without `--out`, sips writes straight into the original file and overwrites it; for non-destructive workflows, work on copies or write deliberately into an output directory. For more complex image manipulation you'd reach for ImageMagick, but for a quick one-off job sips is hard to beat.

## Further Reading

- [sips(1) – macOS man page](https://ss64.com/mac/sips.html) – full option reference at ss64.com
- [Edit images from the command line – Apple Support](https://support.apple.com/guide/terminal/welcome/mac) – Terminal basics from Apple
<!-- PROSE:outro:end -->

## Related Commands

- [caffeinate](https://www.jpkc.com/db/en/cheatsheets/macos/caffeinate/) – keep the Mac from going to sleep
- [defaults](https://www.jpkc.com/db/en/cheatsheets/macos/defaults/) – read and write macOS settings from the terminal
- [diskutil](https://www.jpkc.com/db/en/cheatsheets/macos/diskutil/) – manage disks, partitions and volumes

