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
- 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).