google / guetzli

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

About the opencv imwrite function #232

Open leafjungle opened 7 years ago

leafjungle commented 7 years ago

I did an experiment with two tools: guetzli and opencv(version:2.4, imwrite function). And I found that opencv is much faster(100+ seconds VS 80ms), while the PSNR and compress ratio is almost the same.

So I am so puzzled with the difference between Guetzli and opencv::imwrite? Is that PSNR is not suitable? or Butteraugli is more suitable?

kornelski commented 7 years ago

OpenCV uses libjpeg, so should have same performance as libjpeg used anywhere else.

PSNR is a very poor metric for evaluation of lossy codecs from human perspective (see http://www.ponomarenko.info/tid2013.htm). Guetzli optimizes for Butteraugli, which agrees more with human perception, and scores better on it.

For JPEG optimizing for PSNR is essentially free due to nice mathematical relationship of DCT and PSNR. OTOH computing Butteraugli score is computationally expensive and needs to be done by brute force, which is why Guetzli is so many orders of magnitude slower.

jyrkialakuijala commented 7 years ago

Exactly! In PIK we have designed the compression format in a way that allows us to make psychovisually sound quantization much faster (assuming butteraugli is what we want), and the fast mode of PIK gets already pretty close to butteraugli scores while being roughly as fast as traditional JPEG compression.

leafjungle commented 7 years ago

@pornel , is there an experiment shows the Butteraugli scores of guetzli and libjpeg? (based on the same quality)

kornelski commented 7 years ago

https://arxiv.org/abs/1703.04421

HenkPoley commented 6 years ago

btw, there's a new quality metric that supposedly even more closely mimics human scoring of images (better than Butteraugli).

ssimulacra: https://cloudinary.com/blog/detecting_the_psychovisual_impact_of_compression_related_artifacts_using_ssimulacra

Github repo: https://github.com/cloudinary/ssimulacra