[Image-SIG] How to get quality of picture

Elias Fotinis efotinis at yahoo.com
Mon Sep 28 14:35:54 CEST 2009


From: qiaohl
> Is there any function in PIL to get the value of JPEG quality(1-100)? I 
> know there are functions to set this value, But I found no function to get 
> this value of an existing JPEG file.

You can't get the quality value, because it's not stored anywhere in the 
file.

I found a Microsoft article at http://support.microsoft.com/kb/324790, 
titled "Determine the JPEG quality factor by using Visual C# .NET", which 
states that one could compare the quantization tables against those from the 
reference code. However, you can't be sure it'll work for all JPEGs. 



More information about the Image-SIG mailing list