danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 121 forks source link

SSIM mismatch between jpeg-recompress and jpeg-compare #86

Closed rikonor closed 6 years ago

rikonor commented 6 years ago

I noticed jpeg-compare seems to output a different ssim then jpeg-recompress.

$ jpeg-recompress test-1.jpg test-1.min.jpg
Metadata size is 0kb
ssim at q=67 (40 - 95): 0.997624
ssim at q=81 (68 - 95): 0.998986
ssim at q=88 (82 - 95): 0.999744
ssim at q=92 (89 - 95): 0.999918
ssim at q=90 (89 - 91): 0.999980
Final optimized ssim at q=89: 0.999333
New size is 63% of original (saved 144 kb)

$ jpeg-compare -m ssim test-1.jpg test-1.min.jpg
SSIM: 0.126183
lfos commented 6 years ago

Strange indeed. I will look into it!

lfos commented 6 years ago

Unfortunately, I cannot reproduce the issue. Could you maybe provide your test-1.jpg?

rikonor commented 6 years ago

I think this was the offending code line: https://github.com/danielgtaylor/jpeg-archive/pull/87/files#diff-7b27c889c72c0270c8a94e2d1a08459fL130

Let me know if that makes sense to you, otherwise I can try to write up a repro.

lfos commented 6 years ago

Fixed in 02f30b4 (jpeg-compare: Don't perform grayscale with SSIM, 2018-03-15).