JPEG Quality Settings

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
Zheitk
Posts: 70
Joined: Sun May 01, 2011 3:44 am

JPEG Quality Settings

Post by Zheitk »

Just wondering, why I cant set the jpeg quality to 100?, 99 is the maximum t_t
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: XnConvert v1.20

Post by helmut »

Zheitk wrote:Just wondering, why I cant set the jpeg quality to 100?, 99 is the maximum t_t
JPEG is a lossy format, this means when saving an image some of the image information is lost for better compression. There is no such thing as lossless saving (=100%) in JPEG, unless you use JPEG2000. This is why JPEG quality can be set to a maximum of 99%, only. If you need lossless saving (=100% quality), you should use the PNG format for example.
User avatar
Zheitk
Posts: 70
Joined: Sun May 01, 2011 3:44 am

Re: XnConvert v1.20

Post by Zheitk »

Yea, I Know that even at 100q some quality is lost, It's just that I was testing various batch-converting softwares, all of then let you set the quality at 100q. I find out that most of these software use the same jpeg encoder (at same parameters, they output the same pixel by pixel jpeg), except XnView, so I was just asking why, OK?
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

XnConvert v1.20

Post by helmut »

Zheitk wrote:Yea, I Know that even at 100q some quality is lost, It's just that I was testing various batch-converting softwares, all of then let you set the quality at 100q. I find out that most of these software use the same jpeg encoder (at same parameters, they output the same pixel by pixel jpeg), except XnView, so I was just asking why, OK?
O.k.. I just had a look in XnView (Windows), there you can set JPEG quality from 1% to 100%. In XnConvert it's from 0% to 99%. I'd say that's a bug in XnConvert, quality should also range from 1% to 100%. :bug:
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: XnConvert v1.20

Post by XnTriq »

About.com: JPEG Myths & Facts » Screen Shots of JPEG Save Options for Various Software
XnView ([color=green]I[u]n[/u]fo[/color] » [color=green]About...[/color]) wrote:The JPEG functions are based in part on the work of the Independent JPEG group.
Gordon Richardson (Photo.net » Learn About Photography » Jpeg Compression » [url=http://www.photo.net/learn/jpeg/index.html#qual]Jpeg Quality Settings[/url]) wrote:Ranges of quality settings differ in each implementation, but the IJG values range from 99 (best) to 1 (worst). Please note that these are not percentages, nor is there a direct correlation with the final file size. The example at the top of the page uses an IJG quality setting of 50, and has a file size ratio of roughly 20:1. Anytime you read that an image has been compressed with 10:1 Jpeg quality, you should know that this is slightly misleading (see digital cameras below).
foxyshadis ([url=http://newsgroup.xnview.com/viewtopic.php?p=39042#p39042]Save JPG At 'Original' Quality[/url]) wrote:IJG has a rather interesting way of computing the quality level, which is adding up parts of the quant table. Since almost no tool will use custom quant tables, sadly, let alone multiple tables in a single image, it works pretty well, and it's an easy way to map quality levels between apps.

Adobe's 0-12 scale mapped to Imagemagick's 0-100 scale:
78,81,86,89,90,91,92,91,92,93,95,97,99
(Between 5 and 6, chroma sampling goes from 2x2 to 1x1, thus the backtracking.)
User avatar
Zheitk
Posts: 70
Joined: Sun May 01, 2011 3:44 am

Re: JPEG Quality Settings

Post by Zheitk »

Now I'm more confused: IJG 1-99, XnView 0-99, Most software 0-100. Well, the fact is, that I tested a batch convert with Xnview 0-99 at 90q, and FSviewer 0-100 at 90q, they output exactly the same, So I think both (and most as GIMP/Irfanview & RIOT) use ¿ImageMagick? to compress, so I just wonder why the scale of XnView is different.
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: JPEG Quality Settings

Post by XnTriq »

Zheitk wrote:So I think both (and most as GIMP/Irfanview & RIOT) use ¿ImageMagick? to compress, so I just wonder why the scale of XnView is different.
JPEG compression/decompression/transcoding in FastStone Image Viewer, IrfanView, XnView, and GIMP is based on IJG's (Independent JPEG Group) free open source library.

AFAIK, ImageMagick has it's own JPEG encoder/decoder.
Calvin Hass ([url=http://www.impulseadventure.com/photo/jpeg-quality.html]Comparing JPEG Quality[/url] » Important note about Quality Factors) wrote:It is extremely important that the reader understand that compression quality cannot truly be represented by a single value. JPEG compression quality is actually defined by a pair of quantization tables (each with an array of 64 values). Trying to make a comparison between a pair of matrices is not at all straightforward (or always possible).

So, then why are “quality” numbers listed for each camera/software source? Many programs encode their JPEG images using quantization tables that are generated by scaling the coefficients in a “standard“ table that is provided in the ITU-T specification.

The IJG group has proposed a method of scaling these coefficients according to a “quality factor” scale. This is NOT a percentage! It is merely a number from 1-100 representing the scaling factor used in generating the table. A quality factor of 100 does not mean Lossless compression! Instead, it generally represents the quality factor that will generate the highest quality compressed image with the provided scaling algorithm.

That said, many software programs and some digicams are indeed using scaled versions of this standard table. If we know that a given program has used the IJG scaling method, then we can indeed make a comparison, because all numbers in the matrices will move according to the algorithm in a similar manner.

So, what about other digicams / software editors that didn't use the IJG scaling method? People always love to make comparisons, and comparing multiple 64-element matrices is not intuitive to the average person. Therefore, as an incredibly rough approximation, a calculation has been made for each source to derive the closest / approximate IJG quality factor for a given table. If the quantization tables follow the standard trend of limited compression in the low-frequency components rising to moderate compression in the high-frequency components, then the approximate quality factor may indeed give one an idea as to how the overall quality may appear.
Post Reply