Lossy compression is a class of data compression that achieves high reduction in size by permanently discarding some of the original information. Unlike lossless methods, which allow exact reconstruction, lossy algorithms produce an approximation of the original data when decompressed. This trade-off—smaller files for reduced fidelity—is commonly applied to images, audio, and video where imperfections can be made less noticeable to human senses.

How lossy compression works

The process typically combines several stages: transformation to a domain where redundancies are clearer, quantization that reduces precision, and entropy coding to pack the result efficiently. Compression often relies on models of human perception so that the discarded details are those least likely to be noticed. Key components include:

  • Transform coding: mapping pixels or samples into frequency or basis coefficients where energy is concentrated.
  • Quantization: reducing the precision of coefficients to save bits at the cost of exactness.
  • Perceptual models: using psychoacoustics or visual masking to hide losses beneath thresholds of human perception.
  • Entropy coding: lossless packing of the reduced data to complete the compression pipeline.

Common formats and examples

Several well-known standards implement lossy approaches for different media. For still images, the familiar JPEG standard uses discrete cosine transforms and quantization; for audio, MP3 applies perceptual coding to remove inaudible sounds, often described as a format for sound files. Video codecs blend spatial and temporal techniques; some proprietary containers such as WMV are also lossy. In contrast, formats like GIF and PNG are designed for lossless storage of image data, preserving every bit.

Quality, artifacts and trade-offs

When compression is moderate, losses are often imperceptible; aggressive compression introduces visible or audible artifacts. Image artifacts can include blocking, blurring, or ringing around edges; audio artifacts range from pre-echo to a thin, metallic timbre. The user or application must balance factors such as target size, acceptable quality, and computational cost. Many codecs expose a quality setting so users can tune the compromise between fidelity and file size.

Use cases, history and practical considerations

Lossy compression became widespread as digital media and networks demanded smaller files for storage and delivery. It enables streaming audio and video, reduces download times for web images and accelerates multimedia distribution. Developers and content creators choose lossy methods when file size or bandwidth is the dominant constraint and a degree of inaccuracy is acceptable. For archival, medical, or legal purposes where exact reproduction matters, lossless methods or carefully controlled workflows are preferred.

Further reading and distinctions

For a broader view of compression techniques and terminology see introductory resources on data and reconstruction. Practical guides compare formats and settings for typical tasks such as web publishing, streaming, or audio distribution and explain when to favor lossy over lossless approaches. When referring to individual files, remember conventional file-extension-based names describe containers or formats (for example, a single file may include a lossy-encoded track), and the specific codec and parameters determine the audible or visible outcome.