Seeing JPEG Compression Artifacts


Today’s Question: You suggested not saving an image as a JPEG if it is intended for print, because of the risk of compression artifacts. But what exactly are compression artifacts and what would they look like in the image or the print?

Tim’s Quick Answer: The compression artifacts for JPEG images appear as a grid pattern across the overall image, which is generally somewhat easy to spot if you use a high zoom setting especially on a JPEG image saved with a moderate quality setting.

More Detail: JPEG images use a compression method that is “lossy” meaning that actual pixel values are altered in order to reduce the file size. By contrast, images saved with a lossless compression method will preserve all pixel values precisely, while still reducing the file size. The advantage of lossy compression is that the file can be much smaller, but the disadvantage is the loss of image quality.

The way JPEG files compress image data is to break the image into blocks of pixels and then simplify the pixel data within each block. For example, that might mean a block of 8×8 pixels or 16×16 pixels. The pixel data within each of those blocks is compressed without evaluating the pixel values in neighboring blocks.

Because each block of pixels is compressed in isolation, the changes in one block won’t necessarily align well with the changed pixel values in a neighboring block. This can create an underlying grid pattern in the image that in some cases can be quite visible, both for images shared digitally and those that are printed.

The visibility of JPEG compression artifacts is greater when the image is saved at a relatively low quality setting. With some images, in fact, it may be very difficult to see the compression artifacts if the quality was set to a high value.

To get a better sense of what these JPEG artifacts look like, I recommend saving a copy of an image as a JPEG with the quality setting at the lowest value. For example, you can open an existing JPEG image in Photoshop, and then choose File > Save As from the menu. Specify a unique filename and storage location for this image, so you don’t confuse it with the original image. In the JPEG Options dialog set the Quality value to zero and click OK to save the image.

Next, open the image you just saved, and zoom in closely. You will see a very obvious grid pattern in the image. In fact, at such a low quality setting you may find that some blocks of pixels have been altered so that all pixels in the block (such as an 8×8 pixel block) have all been shifted to the exact same color.

Evaluating a JPEG image that has been saved at the lowest quality setting can help you get a better sense of what the JPEG compression artifacts look like. While these artifacts can be difficult to see on some images saved at a high quality setting, once you know what to look for you may still see artifacts in some areas of the image. Those artifacts, even if difficult to spot, can certainly translate to unwanted artifact patterns in the finished print, or for an image shared online.