Compression in Digital Photography

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

Compression is a big issue when it comes to photographs. You can easily ruin a great image by compressing it too much or too often. When you understand compression in digital photography, you can control it properly to meet the needs of a particular image.

What Is Compression?

Compression is used to reduce the size of any file on a computer, including image files. Files are compressed to reduce their size and make them easier to share on the web. However, when it comes to 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 are able to fit more files onto a camera's memory card, but you are also sacrificing 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

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 8x10-inch print can be affected by 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.

Digital photography has progressed greatly in recent years. Many photographers want the latest camera with the most megapixels and continually upgrade to own the latest technology. However, if those same photographers don't pay attention to compression from the time an image is captured through post-production and storage, then they have squandered the quality they paid for.

How Digital Compression Works

A digital sensor is capable of capturing 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. They are then reconstructed in the image when the file is expanded.

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, it should be noted that each time you open, modify, and then resave a lossy file, a little more detail is lost. 

Tips for Avoiding Compression Issues

Any photographer can take steps to avoid losing the quality of photographs to compression.

  • Shoot in RAW if your camera allows you to. If file size and storage capacity is an issue for you, buy cards that hold more information. RAM is now cheap, and it is affordable to purchase 64GB memory cards or larger. Storage should not be a problem.
  • 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.