danielgtaylor / jpeg-archive

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

Something changed with jpeg-compare and ppm since #87 #92

Closed chregu closed 6 years ago

chregu commented 6 years ago

I get way lower ms-ssim and ssim values since #87 was merged when using ppm as input

Before:

jpeg-compare -m  ms-ssim test.ppm test.jpg
MS-SSIM: 0.993984

After:

jpeg-compare -m  ms-ssim test.ppm test.jpg
MS-SSIM: 0.017351

I can't figure out exactly why or how to solve it, even though the change was really small (it was actually this commit https://github.com/danielgtaylor/jpeg-archive/pull/87/commits/8237f909fa433fbd9aec876160e6df1fe7f6be7b , but since that tries to solve another problem, I don't know how to fix it)

jpeg-recompress seems still to get higher values, eg:

jpeg-recompress -m  ms-ssim test.ppm out.jpg
Metadata size is 0kb
ms-ssim at q=67 (40 - 95): 0.997779
ms-ssim at q=53 (40 - 66): 0.964981
ms-ssim at q=46 (40 - 52): 0.954402
ms-ssim at q=42 (40 - 45): 0.941436
ms-ssim at q=40 (40 - 41): 0.935406
Final optimized ms-ssim at q=41: 0.913196
New size is 1% of original (saved 3053 kb)

But when I then compare that again a really low ms-ssim

jpeg-compare -m  ms-ssim test.ppm test.jpg
MS-SSIM: 0.017351
lfos commented 6 years ago

Fixed in 32b0239 (Fix grayscale conversion in compareFromBuffer(), 2018-05-25) -- thanks for reporting!