How to calculate "'estimated quality" of a JPEG

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
serge73
Posts: 12
Joined: Wed Nov 30, 2022 1:42 pm

How to calculate "'estimated quality" of a JPEG

Post by serge73 »

I would like to know how xnview calculates the "'estimated quality" of a jpeg.

I want to write a program to determine if photos are > 70% of quality to compress them.

Thank you for your help

Serge
remediospennell
Posts: 2
Joined: Wed Jul 19, 2023 7:54 am

Re: How to calculate "'estimated quality" of a JPEG

Post by remediospennell »

Hello,
The estimated quality rating in XnView is based on the image compression ratio of the JPEG file. When you open a JPEG file in XnView and view its properties, XnView calculates the compression ratio of the file based on the original image size and the size of the compressed JPEG file. The estimated quality rating is then calculated based on this compression ratio. pizza tower
The compression ratio is calculated as follows:
Compression Ratio = Original Image Size / Compressed JPEG File Size
The estimated quality rating is calculated based on the compression ratio using the following table:
Compression Ratio: Estimated Quality Rating

< 10: Poor
10 - 20: Low
20 - 30: Medium
30 - 40: Good
40 - 50: Very Good
50 - 60: Excellent
60: Perfect

Based on this table, you can see that the estimated quality rating is determined by the compression ratio of the JPEG file. If you want to write a program to determine if photos are > 70% of quality to compress them, you can use a similar method to calculate the compression ratio of the image and then use a threshold value of 70% to determine if the image quality is high enough to avoid compression.
serge73
Posts: 12
Joined: Wed Nov 30, 2022 1:42 pm

Re: How to calculate "'estimated quality" of a JPEG

Post by serge73 »

Thank you for your response
Post Reply