JamieMason / ImageOptim-CLI

Make optimisation of images part of your automated build process
https://foldleft.io/image-tools
MIT License
3.46k stars 126 forks source link

Output quality loss information #162

Closed JamieMason closed 3 years ago

JamieMason commented 6 years ago

Types of Changes

What types of changes does your issue require? Put an x in all the boxes that apply:

Description

This was a feature in <2.0.0 of imageoptim-cli that needs reinstating.

Suggested Solution

If ImageMagick's compare is installed, or a NodeJS alternative exists, output quality loss information if the stats option is enabled.

kornelski commented 6 years ago

I would advise against using IM's compare command. It only offers naive pixel-by-pixel comparison methods, which reward distortions that are blurry, and penalize good texture-preserving codecs.

In TID2013 benchmark these methods have 30-40% correlation with human judgement, while for JPEG compression DSSIM achieves 94%: https://github.com/kornelski/dssim

JamieMason commented 6 years ago

perfect, thanks @kornelski I will use that.