craftwa.re

A walk outside the sandbox

Home Blog Cheat Sheets MacOS Tips Area 51 About

Batch Convert Images With SIPS

|

Overview

sips is a very useful built-in utility on macOS for scriptable image processing. It can do a lot of stuff, but let’s see a few handy use cases:

  1. Convert multiple images from one format to another (e.g. jpg to png):
$ mkdir PNGs
$ sips -s format png *.jpg --out PNGs
  1. Find and convert only selected images:
$ find . -iname "*.jpg" -type f -exec sh -c 'sips -s format png "$0" --out "${0%}.png"' {} \;
  1. Convert and change image quality (e.g. 60%):
$ sips -s format png -s formatOptions 60 *.jpg -o *.png