← Back

November 23 2026

Benchmarking ImageOptim settings (for optimal image optimizations)


In this article:

In this article I explore the effect of different ImageOptim settings on a small dataset, including the time/compression tradeoff between lossless compression levels, and optimal quality levels for lossy compression.

TL;DR: For lossless compression, stick to Fast, not the default Extra. For lossy compression, q90 is a great sweet-spot between quality and filesize reduction.

Introduction

I’m a huge fan of ImageOptim!

I’ve used it for years to quickly & easily optimize images for my websites - primarily because it just… works.

You open the app, drag in a bunch of images, and it compresses them (losslessly or lossily depending on your settings). At the end you get a handy breakdown of the new filesizes and savings:

ImageOptim UIThe ImageOptim interface after optimizing the 11 images in the dataset losslessly.

But recently I started wondering - how could I tweak ImageOptim to do the best job possible of optimizing my images, in terms of the speed/size/compression tradeoffs.

See, ImageOptim lets you adjust a few settings:

  • General settings: primarily to toggle various optimization algorithms
  • Quality: Enable / disable lossy minification, with quality targets
  • Optimization speed: How much time it spends trying to optimize each image

But which values should you choose?

What’s a good choice for, say, Optimization Speed?

When set to “Insane”, it certainly spends a heap more time optimizing… but is the extra time actually worth it? And what about lossy quality levels?

Let’s find out!

Benchmarking ImageOptim settings

I decided to put together a little Ruby script (with some help from trusty Claude) to run ImageOptim over a collection of image (40.6 MB) on my M4 MacBook, iterating through each setting and measuring how much each image shrinks (and how long it takes).

The dataset was a mixture of 11 images, plucked from stuff I had on my laptop already, roughly matching the kinds of images I actually host online - mostly .png screenshots, plus two .jpg photos from my phone. The largest image was 10.7 MB, and the smallest 35 KB.

Across the dataset, I tested:

  • all 7 lossless speed levels,
  • plus 7 lossy quality levels (q99, 95, 90, 85, 80, 75 and 70, at Normal speed).

I ran all tests against ImageOptim’s default algorithm settings.

You can download the dataset and benchmark script (38 MB zip) to run it yourself.

Overall compression

From our original dataset size of 40.6 MB, we were able to compress it down to:

  • 30.27 MB (-25.5%) losslessly @ Fast speed in 167s
  • 29.69 MB (-26.9%) losslessly @ Insane speed in 581s
  • 16.36 MB (-59.7%) lossily @ q90

Here’s a chart for a bit more of a breakdown.

Note that (in this dataset) lossless compression levels make little difference, and the biggest lossy compression jump is from q99 -> q95:

Lossless compression

For years I’ve been dutifully optimizing images at the Extra level, believing that, while a bit slow, I was getting a decent boost to compression levels in return.

Turns out… not the case!

In my testing, Fast (the fastest setting) gave compression levels within ~2% of Insane (the slowest setting)… and it runs 3.5x faster (167s vs 581s) across the whole dataset.

Interestingly, the optimization speed setting only really affects PNGs (GIFs get one extra pass, JPGs ignore it entirely).

I don’t believe this is publicly documented, but you can see this area in the source code where level, the optimization level, gets passed to the various PNG optimization algorithms.

Lossy compression

I don’t normally dabble with lossy compression, because I don’t want to degrade my images.

However, in the pursuit of better PageSpeed scores I wanted to explore these settings too, and I wasn’t disappointed - on my mini-dataset, I was able to achieve substantially more compression while keeping quality high (measured with SSIMULACRA2).

JPGs and PNGs behave differently though:

  • For PNGs the setting is a minimum quality (not a target). A file will either pass the threshold and get compressed, or falls short and leaves the file lossless. That’s why the line is quite sharp.
  • For JPGs the setting is a max quality threshold - anything saved above it gets re-encoded down, so quality drops smoothly.

At q90, the median image shrinks 72%, and every image still scores well above 75+ (high quality).

Conclusion & Notes

Thanks for reading!

I hope you found this useful in some way - for me at least, I’m already appreciating the speed benefits of Fast vs Extra, and I’ve done a lossy pass over the images for AttendList to shrink them considerably.

While you’re here, please note that - of course - this is absolutely not a perfect test! For instance, most of the images in the dataset are .png screenshots (since that’s the kind of images I tend to put on websites). YMMV drastically depending on the images you’re optimizing.