Print data

Data compression: loss-free vs. lossy

By Patrycja Czochara • Last updated 14.03.2024

What are compression artifacts and data compression?

Compression artifacts are unwanted effects or visible changes in the quality of digital media caused by the use of data compression.

Data compression is a process used to reduce the file size of digital media such as images, videos or audio in order to save storage space or improve transmission speed.

 

There are two main types of data compression

Lossless compression

With this method, the file size is reduced without losing any information. No loss of quality is observed and the original data can be fully restored.

Examples of lossless compression formats are PNG for images and FLAC for audio.

 

Lossy compression

This method results in a loss of quality as some data is removed to reduce the file size. The loss of quality is often acceptable to the human eye or ear and allows significant savings in file size.

Examples of lossy compression formats are JPEG for images, MP3 for audio and various video formats such as MPEG. This is why compression artifacts are colloquially referred to as JPEG artifacts. 

 


The JPEG artefacts are clearly visible on the left

 

How can you recognize lossy data compression?

Compression artefacts can occur in the form of blocking, blurring, color changes or other visual or auditory irregularities, especially if the data has been heavily compressed.

 

Advantages and disadvantages of data compression

Advantages:

  1. Saves storage space: Compressed data requires less storage space on data carriers or in the cloud.
  2. Faster transmission: By reducing the amount of data, compressed data can be transferred faster over networks.
  3. Bandwidth efficiency: Compression optimizes the use of available bandwidth, which is particularly beneficial in environments with limited bandwidth.

Disadvantages:

  1. Loss of data quality: Lossy compression can impair the quality of data such as images, audio or video.
  2. Computing intensity: The compression and decompression algorithms often require considerable computing power.
  3. Not suitable for all data: Some types of data cannot be compressed effectively, which can result in minimal savings or even an increase in file size.