From: Eric Durant Subject: Re: JPEG and Compresion Ratio Date: 08 May 2000 00:00:00 GMT Message-ID: <3916D256.13FA2633@engin.umich.edu> Content-Transfer-Encoding: 7bit References: <8enc6v$iu8$1@hercules.iupui.edu> <3910F193.81C507D5@engin.umich.edu> <00c89a7a.c52918f2@usw-ex0105-035.remarq.com> X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@eecs.umich.edu X-Trace: news.eecs.umich.edu 957797051 95398 141.213.6.60 (8 May 2000 14:44:11 GMT) Organization: EECS Dept. Univ. of Michigan Mime-Version: 1.0 Newsgroups: comp.soft-sys.matlab,sci.image.processing fxfake wrote: >[Eric Durant wrote:] >>The other followups are generally correct. To make it >>explicit -- there is no simple relation between the quality >>factor and the compression ratio; it depends upon the image. >The relationship follows a rate-distortion curve (I think it's >a Lagrange (sp?) curve). The higher the rate, the lower the >distortion, up to zero distortion a some bit-count and maximum >distortion at zero bit-count (zero rate). That's right, an R-D curve exists, but there is not an image independent relationship between the distortion and the quality factor. >>If you want the true compression ratio, you could write a >>program to parse through the JPEG file and add up the lengths >>of the image >The true compression ratio includes all of the information in >the file (for all intents and purposes). The original poster expressed an interest in measuring the image data in isolation of header data, so I don't think his intents and purposes are the same as yours. He called the ratio based on this the "actual" compression ratio and I called it "true"; both of these are ambiguous depending upon how you look at the problem -- perhaps "internal" and "external" compression ratio is clearer terminology. >You could measure the distortion by saving a tif copy of the >image and a jpeg copy, [...] >By doing this many times using different quality >factors you can get a picture (make a plot of distortion as a >function of quality factor) of the effects of the quality factor. [...] I created JPEG R-D curves by sweeping the quality factor as part of a larger project about a year ago (Matlab's IMWRITE was used to create the JPEGs; details in the reference). If anyone is interested in these for 2 test images (Lena and an amateur photograph), please see either of the following (818 kB). ftp://ftp.eecs.umich.edu/people/edurant/eecs651.ps.gz http://www.edurant.com/papers/eecs651_JPEGEnhancements.ps.gz The "True JPEG" R-D curves on the pages numbered 16 and 19 are what is of interest here. -- Eric Durant http://www.edurant.com/