jpeg compression ratio

﹥>﹥吖頭↗ 提交于 2019-12-19 05:32:14

问题


Is there a table that gives the compression ratio of a jpeg image at a given quality?

Something like the table given on the wiki page, except for more values.

A formula could also do the trick.

Bonus: Are the [compression ratio] values on the wiki page roughly true for all images? Does the ratio depend on what the image is and the size of the image?

Purpose of these questions: I am trying to determine the upper bound of the size of a compressed image for a given quality.

Note: I am not looking to make a table myself(I already have). I am looking for other data to check with my own.


回答1:


I had exactly the same question and I was disappointed that no one created such table (studies based on a single classic Lena image or JPEG tombstone are looking ridiculous). That's why I made my own study. I cannot say that it is perfect, but it is definitely better than others.

I took 60 real life photos from different devices with different dimensions. I created a script which compress them with different JPEG quality values (it uses our company imaging library, but it is based on libjpeg, so it should be fine for other software as well) and saved results to CSV file. After some Excel magic, I came to the following values (note, I did not calculated anything for JPEG quality lower than 55 as they seem to be useless to me):

Q=55    43.27
Q=60    36.90
Q=65    34.24
Q=70    31.50
Q=75    26.00
Q=80    25.06
Q=85    19.08
Q=90    14.30
Q=95    9.88
Q=100   5.27

To tell the truth, the dispersion of the values is significant (e.g. for Q=55 min compression ratio is 22.91 while max value is 116.55) and the distribution is not normal. So it is not so easy to understand what value should be taken as typical for a specific JPEG quality. But I think these values are good as a rough estimate.

I wrote a blog post which explains how I received these numbers.

http://www.graphicsmill.com/blog/2014/11/06/Compression-ratio-for-different-JPEG-quality-values

Hopefully anyone will find it useful.




回答2:


Browsing Wikipedia a little more led to http://en.wikipedia.org/wiki/Standard_test_image and Kodak's test suite. Although they're a little outdated and small, you could make your own table.

Alternately, pictures of stars and galaxies from NASA.gov should stress the compressor well, being large, almost exclusively composed of tiny speckled detail, and distributed in uncompressed format. In other words, HUBBLE GOTCHOO!




回答3:


The compression you get will depend on what the image is of as well as the size. Obviously a larger image will produce a larger file even if it's of the same scene.

As an example, a random set of photos from my digital camera (a Canon EOS 450) range from 1.8MB to 3.6MB. Another set has even more variation - 1.5MB to 4.6MB.



来源:https://stackoverflow.com/questions/3471663/jpeg-compression-ratio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!