guetzli icon indicating copy to clipboard operation
guetzli copied to clipboard

About the opencv imwrite function

Open leafjungle opened this issue 6 years ago • 5 comments

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?

leafjungle avatar Aug 26 '17 10:08 leafjungle

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.

kornelski avatar Aug 26 '17 22:08 kornelski

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.

jyrkialakuijala avatar Sep 04 '17 19:09 jyrkialakuijala

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

leafjungle avatar Sep 12 '17 06:09 leafjungle

https://arxiv.org/abs/1703.04421

kornelski avatar Sep 12 '17 15:09 kornelski

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

HenkPoley avatar Sep 28 '17 13:09 HenkPoley