danielgtaylor / jpeg-archive

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

jpeg-recompress runs multiple loops with exact same quality #95

Closed sourcejedi closed 6 years ago

sourcejedi commented 6 years ago

jpeg-recompress performance would benefit from an early-termination check, when the quality range is narrow :-D.

Metadata size is 19kb
ssim at q=91 (87 - 95): 0.998820
ssim at q=93 (92 - 95): 0.999128
ssim at q=94 (94 - 95): 0.999288
ssim at q=95 (95 - 95): 0.999430
ssim at q=95 (95 - 95): 0.999430
Final optimized ssim at q=95: 0.999119

E.g. reducing to --loops=4 brought down the time per image from 2.22 seconds to 1.67, a performance improvement of 33%.


Thanks for the software! I'd probably be happy with mozjpeg q=90, but being able to vary the quality over a small range in that area is even better.

lfos commented 6 years ago

Fixed in 8da4bf7. Thanks for reporting!