Glossary Term

Lossy Compression

Lossy compression reduces file size by permanently discarding image data that the human eye is less likely to notice — producing smaller files at the cost of some visual quality.

How lossy compression works

Lossy compression exploits the limitations of human vision. The eye is more sensitive to brightness changes than color changes, more attuned to low-frequency patterns than high-frequency detail, and less able to detect small variations in complex textures. Lossy algorithms use these perceptual shortcuts to remove data that contributes minimally to how the image looks.

JPG, the most common lossy format, divides the image into 8x8 pixel blocks, converts each block into frequency components using a mathematical transform (DCT), and then discards the high-frequency components that represent fine detail. The quality setting controls how aggressively these components are removed. At high quality, only the least perceptible data is discarded. At low quality, more data is removed, producing smaller files but visible degradation.

Modern lossy formats like WebP and AVIF use more sophisticated approaches — variable block sizes, better prediction models, and advanced entropy coding — achieving the same perceived quality at smaller file sizes than JPG. The principle remains the same: strategically discard what the viewer will not miss.

The irreversible nature of lossy compression is critical to understand. Once data is discarded, it is gone permanently. Saving a lossy file at higher quality does not restore the lost information — it simply applies less additional compression to the already-degraded data.

Lossy formats: JPG, WebP lossy, AVIF

Each lossy format applies the same general principle with different levels of sophistication.

  • JPG — the oldest and most widely supported lossy format. Its 8x8 block structure can produce visible blockiness at lower quality settings, particularly around sharp edges and text. Universally compatible but technically outdated.
  • WebP lossy — produces files roughly 25-35% smaller than JPG at equivalent quality. Handles edges and text better than JPG and supports transparency, which JPG does not. Supported by all modern browsers.
  • AVIF — the most efficient lossy format currently available, achieving files roughly 50% smaller than JPG. Superior handling of gradients and complex textures. Slower encoding speed and narrower (but growing) platform support.

For workflows that involve exporting images to multiple destinations, tools that support format selection at export time allow choosing the right lossy format based on the destination's compatibility requirements.

A practical pattern is to keep a lossless source file through editing, then export one lossy derivative for the final destination. That gives you the bandwidth savings of lossy compression without stacking multiple rounds of quality loss.

Lossy vs lossless

The choice depends on the content and its intended use.

Lossy compression excels when file size is a priority and the content is photographic or visually rich. A photograph shared on social media, a product image on a web page, or a background graphic in a presentation — these all benefit from lossy compression's dramatic size reduction with minimal visible impact.

Lossless compression is essential when the image contains information that must be preserved exactly. Screenshots with readable text, technical diagrams with precise measurements, medical images, legal evidence, and any content intended for further editing should use lossless formats.

The worst case for lossy compression is text-heavy screenshots. Sharp text edges create exactly the kind of high-frequency detail that lossy algorithms aggressively discard. The result is blurry, ringed, or blocky text that may be difficult or impossible to read. This is why many capture tools default to PNG (lossless) rather than JPG (lossy) for screenshot output.

A practical workflow is to capture in lossless format, make any needed edits, and then export a lossy version only at the final distribution step. This avoids compounding quality loss through multiple lossy saves.

Common mistakes

  • Using lossy compression for text-heavy screenshots. Text is highly sensitive to compression artifacts. Use lossless formats (PNG, WebP lossless) for screenshots where text readability matters.
  • Repeatedly saving in lossy format. Each save applies another round of compression, progressively degrading the image. Edit from a lossless source and save lossy only once, at the end.
  • Setting quality too low to save space. Below 70% quality, most images show obvious artifacts. The file size difference between 50% and 80% quality is often small relative to the visible quality loss.
  • Setting quality too high. Above 90-95%, file sizes increase sharply with almost no visible improvement. Find the sweet spot where quality is indistinguishable from lossless but the file is meaningfully smaller.

Common Questions

Does lossy compression ruin image quality?

Not necessarily. At moderate quality settings, lossy compression removes data that the human eye is unlikely to detect. The quality loss only becomes visible at aggressive compression levels or after repeated re-compression of the same file.

Can you undo lossy compression?

No. Lossy compression permanently discards data. Once an image is saved with lossy compression, the removed information cannot be recovered. This is why keeping a lossless original is recommended for images that may need editing later.

Is JPG lossy?

Yes. JPG always uses lossy compression. Every time a JPG file is saved, some data is discarded. This is why repeatedly opening and saving the same JPG file gradually degrades its quality.

What quality setting should I use for lossy compression?

For most purposes, 80-85% quality provides a good balance between file size and visual fidelity. Below 70%, artifacts become noticeable in most images. Above 90%, file sizes increase substantially with diminishing visual returns.

Why do screenshots sometimes look blurry after compression?

Screenshots contain sharp edges and text that are highly sensitive to lossy compression artifacts. Lossy algorithms are optimized for photographic content with gradual transitions, not the hard edges found in UI elements. Use lossless formats for text-heavy screenshots.

Sources

Related Resources