Hacker News new | ask | show | jobs
by willmacdonald 1386 days ago
There is a great mac app called https://imageoptim.com/mac

It tries - zopfli - PNGOUT - OxiPNG - AdvPNG - PNGCrush - JpegOptim - Jpegtran - Guetzli - Gifsicle - SVGO - svgcleaner

And picks the best result. You can tweak a few other settings too.

It is a great tool which allows you drop a folder of mixed images, and just wait for the result.

3 comments

ImageOptim is fantastic. You can use it via CLI, so I've added it to a few different archiving / publishing workflows in the past. One thing that some people don't realize is you can run it multiple times on the same (PNG) images and get better results. Each filter is dependent on the input from the previous filter, so running them again can give you better results even after one run. This works out because filter 3 might give you some savings or rearrange the data in a way that filter 1 can now take advantage of.

The other JPG filters are lossless, but be aware that Guetzli is lossy!

I was impressed with just how much it could losslessly compress some massive JPGs until I did a visual diff. I can't see the difference, like one-bit deltas sort of thing, but it's not 1:1 lossless as I would expect.

ImageOptim flies on an M1 compared to an Intel Mac. One of my favorite apps, I use it almost daily.
zopflipng typically beats pngcrus and optipng (on Linux at least) but by default it drops auxillary PNG chunks [0] which can result in browsers (and other applications) using a different color space, causing the resulting images to look more washed out than the original. To prevent this you need to explicitly pass --keepchunks=cHRM,gAMA,pHYs,iCCP,sRGB,oFFs,sTER to zopflipng.

cwebp seems to have a simmilar issue when starting with png files. Sucks that color space support is still so inconsistent.

Unfortunately zopflipng (and most other tools) don't have APNG support, keeping only the first frame :|

[0] https://github.com/google/zopfli/issues/113