Optimage

Usage

To start optimization in Optimage, do any of the following:

Preferences

Command line usage

You can launch Optimage in interactive mode by running the following command in Terminal.

open -a Optimage image-file …

If you want to block the command execution until all images are optimized, use the following command.

open -W -n -a Optimage image-file … --args -exit YES

or

/Applications/Optimage.app/Contents/MacOS/Optimage -exit YES image-file …

You can easily get the command that matches your current Preferences with Copy Command in Edit menu. It is recommended to always launch a new app instance and block command execution because the command line options are not passed on reopening.

There is also a CLI client in the application bundle. If you have Optimage installed in the Applications folder, it is located under /Applications/Optimage.app/Contents/MacOS/cli/optimage. You can create a soft link for faster access.

ln -s /path/to/cli/optimage /usr/local/bin

Usage examples:

Run lossy optimizations on a set of images.

optimage --lossy --srgb --strip-meta -v -- image-file …

Run lossy optimizations in parallel on all images in the folder.

find -E /path/to/image/folder -type f -iregex '.*\.(png|jpe?g)' -print0 | xargs -0 -I {} -P 8 optimage --lossy --srgb --strip-meta -v -- {}

or

find /path/to/image/folder -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' \) -print0 | xargs -0 -I {} -P 8 optimage --lossy --srgb --strip-meta -v -- {}

Run optimage -h to get help. Currently, the CLI supports only PNG and JPEG.