Compression in Digital Photography

Compressed pictures trade file size for image precision

Focused female photographer using digital camera at photo shoot in studio
Hero Images / Getty Images

You'll easily ruin a great image by compressing it too much or too often. Compression in digital photography is a powerful image-management tool, provided the technique is used with care.

What Is Compression?

Compression reduces the size of any file on a computer, including image files. However, for photographs, compression is not always a good thing because compression can affect image quality.

Different photography file formats on DSLR cameras and computers apply different levels of compression. When an image is compressed—in a camera or a computer—less information is in the file, and the finer details of color, contrast, and sharpness are reduced.

With a compression format such as that found in a JPEG file, you'll fit more files onto a camera's memory card, but you'll also sacrifice quality. Advanced photographers avoid compression by shooting RAW files, which have no compression applied to them. However, for general photography, the compression found in JPEGs is not a significant drawback.

Noticing Compression

compressed image comparison

The difference in compression formats may not be noticeable on the camera's LCD screen or even a computer monitor. It is most evident when an image is printed, especially if it is enlarged. Even the quality of an 8-inch-by-10-inch degrades with too much compression. However, if you're just sharing a photo on social media, a loss of quality through compression isn't enough to be noticeable.

Check your DSLR's settings to ensure you're not compressing the image by default.

How Digital Compression Works

A digital sensor captures far more information than the human eye can process. Therefore, some of this information can be removed during compression without the viewer noticing.

The compression mechanism looks for any large areas of repetitive color and removes some of the repeated areas. Those areas reconstruct in the image when the file is expanded, through an interpolation process.

The Two Types of Image Compression

The two types of compression are lossless and lossy, and they mean exactly what they sound like they mean.

Lossless Compression — similar to creating a ZIP file on a computer. Data is compressed to make it smaller, but no quality is lost when the file is extracted and opened at full size. An image that had been through a form of lossless compression is identical to the original image. TIFF is the most commonly used file format that uses lossless compression.

Lossy Compression  works by discarding some information, and the amount of compression applied can be chosen by the photographer. JPEG is the most commonly used file format for lossy compression. It allows photographers to save space on memory cards or to produce files suitable for emailing or posting online. However, each time you open, modify, and then resave a lossy file, a little more detail irretrievably vanishes. 

Tips for Avoiding Compression Problems

Avoid losing the quality of photographs to compression:

  • Shoot in RAW if your camera allows you to. Buy cards that hold more information if you run against space constraints. RAM is now cheap, and it is affordable to purchase 64GB memory cards or larger.
  • Save your working and finished image files as TIFFs. After you convert an image from RAW format, save it in a lossless file format and store it securely. Use JPEG compression on a copy of the original image for sharing.
  • Stop saving over JPG files. Each time you open and resave a lossy compression file like JPEGs, you lose image quality.