6
\$\begingroup\$

JPEG encoders usually use a quality setting of 0-100, whereas Adobe photo software uses a 0-12 setting. Does anyone know how to convert between these?

(I am actually not clear on whether the 0-100 quality setting simply became common since the independent JPEG groups encoder did so, or if such a scheme is part of the JPEG standard itself).

I looked around to see if someone else asked this, thinking someone already would have. There were related questions that I found, but not this one. Please correct me if I'm wrong and I'll delete my question.

\$\endgroup\$
5
  • 2
    \$\begingroup\$ Does Why does JPEG quality go up to twelve? cover it? \$\endgroup\$
    – mattdm
    Commented Dec 3, 2014 at 18:59
  • \$\begingroup\$ I did see that one. I didn't think it did. But possibly it is the case that quality number 0-100 isn't actually part of the jpeg standard (i.e. there aren't quantization tables specified in the standard by a given quality number) and so there IS no direct translation between adobes and libjpegs quality numbers because they actually use different quantization tables altogether. If that is the case, then there really isn't a translation between them and the answer you pointed to is as good as it is going to get. \$\endgroup\$ Commented Dec 3, 2014 at 19:15
  • 3
    \$\begingroup\$ It actually is defined in the standard but many encoders use a 0-100 scale which doesn't correspond to this. \$\endgroup\$
    – mattdm
    Commented Dec 3, 2014 at 19:25
  • \$\begingroup\$ If nothing else, this question has a much better title (in terms of what people might search for) than the potential dupe. \$\endgroup\$
    – Philip Kendall
    Commented Dec 3, 2014 at 20:49
  • \$\begingroup\$ FWIW I think we should keep this open, especially with specific answers coming in. \$\endgroup\$
    – mattdm
    Commented Dec 4, 2014 at 11:43

2 Answers 2

5
\$\begingroup\$

In the Save As function the 0-12 quality scale is used, but in the Save For Web function a 0-100 scale is used. That 0-100 scale is probably close to the 1-99 scale specified in the standards.

I compared the file sizes from the different settings, using a 21 MP image (so that the metadata is tiny compared to the image data), and came to this approximate relations:

SA   MB    SFW

0    0.86  n/a
1    0.98  2
2    1.2   9
3    1.4   19
4    1.6   20
5    1.9   27
6    2.5   36
7    2.5   37
8    3.4   51
9    4.4   63
10   6.0   73
11   8.7   85
12   14.3  98
n/a  15.0  100

This tells us that it's not just a direct translation between the numbers. Although this only compares the file size and not the percieved quality, it gives you a rough translation between the values.

The Save For Web function supposedly uses quantization tables specially intended for small images displayed on a screen (which apparently makes it less optimal for such a large image that I used).

\$\endgroup\$
2
  • 2
    \$\begingroup\$ don't forget about chroma subsampling - photoshop probably selects 4:4:4 or 4:2:0 depending on its quality selector, while in gimp it is not linked (another degree of freedom). \$\endgroup\$
    – szulat
    Commented Dec 5, 2014 at 9:33
  • \$\begingroup\$ Those numbers are wrong because they don't account for chroma subsampling. \$\endgroup\$
    – xiota
    Commented Jul 14, 2018 at 6:18
6
\$\begingroup\$

There is not a direct correspondance between standard JPEG quality 1-100 and Photoshop 0-12. The only thing they have in common is that to a bigger number usually corresponds to better quality.

Quantization tables and image quality

JPEG compression is a broad topic. There are many different parameters to consider, but the main element that affects image quality are the quantization tables. The quantization table is a 64-element matrix (8x8) that defines how to scale and round different frequency coefficients in the image. The IJG (Independent JPEG Group) define a formula to create quantization tables with quality 1 to 100. Quality 100 means a quantization table that is composed entirely of ones, hence no compression due to quantization.

Most digital-camera producers, and some image-processing software producers, don't use the standard quantization tables. They use custom tables to fine tune the compromise between compression and quality according to the features of the specific device.

No direct correspondence to IJG image quality is possible with custom tables because the quality setting is defined only for the standard tables. However, for a specific custom table, it is possible to find the nearest equivalent standard table.

Photoshop quantization tables

Photoshop does not use standard tables. I saved a sample image with all the possible quality settings. These are the closest standard quality levels for each Photoshop setting:

  • Photoshop Save As 00: IJG 46
  • Photoshop Save As 01: IJG 52
  • Photoshop Save As 02: IJG 63
  • Photoshop Save As 03: IJG 66
  • Photoshop Save As 04: IJG 71
  • Photoshop Save As 05: IJG 75
  • Photoshop Save As 06: IJG 81 (!!!)
  • Photoshop Save As 07: IJG 78
  • Photoshop Save As 08: IJG 84
  • Photoshop Save As 09: IJG 88
  • Photoshop Save As 10: IJG 92
  • Photoshop Save As 11: IJG 96
  • Photoshop Save As 12: IJG 98

The results are the same regardless of whether you choose Baseline (Standard), Baseline(Optimized), or Progressive.

If you use Save for Web, Photoshop uses a different set of quantization tables. Although the numbers look similar to the IJG standard, don't be fooled. Photoshop still uses custom quantization tables. Here are my results with Photoshop values 50 to 100 with a step of 10. 

  • Photoshop Save for Web 050: IJG 82
  • Photoshop Save for Web 060: IJG 86
  • Photoshop Save for Web 070: IJG 91
  • Photoshop Save for Web 080: IJG 94
  • Photoshop Save for Web 090: IJG 97
  • Photoshop Save for Web 100: IJG 98

Bonus facts

  • Photoshop quantization tables are the same since version 3 (not CS3)!
  • Quality 7 actually has lossier quantization tables than quality 6. This is because quality 7 and above disables chroma subsampling, improving color accuracy but increasing the file size.
  • The quality 12 still yield some compression (the quantization table is not full of 1s, but there are also some 2s and 3s).
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.