When trying to resave a digital image in the JPEG file format, one is often required to make a decision as to what quality setting or level of compression to use. The JPEG (or JPG) format allows one to make a trade-off between file size and image quality by selecting an appropriate level of compression. But the scale used to indicate compression level is not consistent across all image editors or cameras. This is because there are thousands of different ways a JPEG image can be compressed, and software developers and camera manufacturers prefer to use methods they feel are right for their product. Some developers have even coded their own algorithms.
While researching on JPEG image quality of different digital camera models and software image editors, developer Calvin Hass discovered a strange behavior in Adobe Photoshop CS2.
What many people don't know is that there is a quirk in the way that Photoshop defines its quality range. As mentioned earlier, Quality level 6 is the last point in which chroma subsampling is used. At Quality level 7 and higher, no chroma subsampling is used at all. With the amount of color information encoded now doubled, the file size would have naturally increased significantly at this level versus the previous level.
However, it is likely that Adobe decided to allocate the various quality levels with some relationship to the final compressed file size. Therefore, Adobe chose a poorer luminance and chrominance compression quality (i.e. higher level of compression) in Quality level 7 than Quality level 6! What this means is that the image quality of Quality level 7 is actually lower than Quality level 6 (at least from luminance detail perspective).
Let me explain that in plain English:
There are two type of information that needs to be saved in a digital image - information about brightness or luminance of each pixel on the image and information about color or chrominance of the pixels. The human eye’s ability to differentiate between colors is less than the acuity with which it can detect changes in brightness. The JPEG format takes advantage of this handicap by sampling the color information in the image at resolutions lesser than the one used for sampling brightness. This is known as chroma subsampling. With less color information to store, the size of the JPEG image is reduced.
Photoshop CS2 uses chrome subsampling for all quality levels lesser than, and including, 6. Starting quality level 7 and higher, no chroma sampling is used to improve color resolution and quality of the image. The flip side of discarding chroma sampling is that the amount of color information to encode is now doubled and subsequently the file size is increased.
Adobe, not wanting the file size to make a giant leap when going from 6 to 7, decided to notch up the compression level in quality 7 to keep file size under check. This actually results in a lesser image quality in level 7 than in level 6!
So whenever you save image using Photoshop, don’t use quality 7. Either use 6 or 8 and above. Compared to quality level 7, images saved with quality level 6 have far better compressed image quality in both the chrominance and luminance channels.
Surprisingly, the poor chrominance information extends even to quality level 8. When quality level 6 is compared with quality level 8, images saved with quality level 6 is found to have better compressed image quality in the chrominance channels than images saved with quality level 8. But quality level 8 show better image quality in the luminance channel than quality level 6.
Now recall that the human eye has better resolution for brightness than for color. So quality level 8 appears better than quality level 6.
In short, if smaller file size is desired – use Quality level 6 or less. If higher quality is desired - use Quality level 8 or more. Don’t use Quality level 7.
Quality level 10 is the most anyone should use. Level 11 and 12 are there purely for experimental reasons (not much gain in quality for a large increase in file size).
For comparison of JPEG image quality see this page.