Glossary

Full glossary

Lossy compression

Simple diagram of lossy compression, boxes going from original to compressed to restored.

What is lossy compression?

Lossy compression is a way of compressing data where you reduce the file size by removing data in the file. Another name for it is irreversible compression, because you can't return to the original image, video, or audio that you started out with. In discussions, you will often hear either lossy vs. lossless compression or irreversible and reversible compression. (Though the latter terms are more common if you are looking at medical data.)

What are some popular lossy compression techniques?

The most common lossy data compression techniques are transform coding and predictive coding. Generally speaking, transform coding involves taking samples of images or sound, chopping them into small segments, then quantizing them. Quantization is the process of determining what parts of an image you can discard or consolidate with minimal loss in quality. The most common lossy compression algorithm is the discrete cosign transform (DCT), which was first published by Nasir Ahmed and K.R. Rao in 1974. Predictive coding involves taking previous or following decoded data to predict the current sample of audio or an image frame.

The goal of lossy compression is to be able to reconstruct data in a way where you don't notice that some of the original data is missing. Many popular video compression standards are lossy, for example H.264, H.265, AV1 and VP9 to name a few.

As the algorithms for compression improve, videos are able to be compressed at a greater rate, with less perceived loss of quality. This is due to the improved quantization math that is run in each generation of video compression. This improved compression allows for larger dimension video to be transmitted without drastic bandwidth improvements. For example, the compression between VP9 and AV1 (a generational shift in the same platform) reduces the file size by nearly 50%.

While lossy compression can help video be transmitted more rapidly and take up less space, this type of format suffers from generation loss. Over time if you continue to compress and decompress your file using lossy compression methods you will decrease the quality of your file over time. Best practice is to keep a back up of your video files using a lossless compression method so you can preserve a high quality version of your file to use when needed.

api.video and lossy compression

At api.video, we transcode all content into HLS, which is the industry standard for streaming your video in the highest quality possible across the internet. HLS uses H.264 video compression, which is lossy in a way that you won't notice.