google / guetzli

Perceptual JPEG encoder
Apache License 2.0
12.9k stars 976 forks source link

Unbelievably good encoding performance? #65

Closed Smilebags closed 7 years ago

Smilebags commented 7 years ago

It seems unrealistic, but testing on 128px square images at 90 quality, I'm getting roughly 10x smaller files than PS saving the same images at 9 quality. Visual quality is comparable.

I've written a blog post showing the results and will attach a zip of the results later. http://uxgroup.com.au/using-googles-guetzli-jpeg-encoder

This isn't a bug, but I want to know what factor is resulting in this performance, as it doesn't seem to be normal.

kornelski commented 7 years ago

Photoshop adds a lot of unnecessary large metadata to saved files, especially if you use color profiles.

Use a JPEG optimizer to remove the invisible junk first (jpegoptim, ImageOptim) or at least only use "Save for Web" (without embedded profiles, converted to sRGB) for generating JPEGs from Photoshop when file size matters.

Also "almost the same" is not enough — very small changes in JPEG quality setting, regardless of encoder used, can easily halve or double its size: https://kornel.ski/en/faircomparison

It's best to try many quality settings until you produce different files at exactly the same file size, and then see which has higher quality.

Smilebags commented 7 years ago

Thanks for the explanation. I had a feeling something like that was going on. That helps clear it up.

hazarkarabay commented 7 years ago

Adobe Photoshop has "Save for Web" feature that strips metadata and gives finer control on its output.

robryk commented 7 years ago

It was likely the color profile information that Guetzli dropped. Guetzli, by default, preserves e.g. all application-specific markers.