jpeg compression ratio

前端 未结 3 515
难免孤独
难免孤独 2021-01-04 08:31

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.

<
相关标签:
3条回答
  • 2021-01-04 08:35

    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!

    0 讨论(0)
  • 2021-01-04 08:42

    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.

    0 讨论(0)
  • 2021-01-04 08:55

    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.

    0 讨论(0)
提交回复
热议问题