Lossy compression is a data-compression technique in which some information from the original data is deliberately discarded or approximated so that the compressed representation requires fewer bits. When the compressed data is decompressed, the result is therefore not necessarily identical to the original. In image processing, lossy compression is widely used because human perception does not treat every pixel difference as equally important.
A well-designed lossy image codec can remove or reduce information that is difficult to perceive while preserving structures that strongly influence visual appearance. JPEG is a classic example, while WebP and AVIF also provide lossy image-compression modes. Lossy compression is not inherently equivalent to poor quality; its purpose is to control the trade-off between file size and fidelity.
Lossy image compression generally operates by transforming, predicting, quantising and coding image information. Different codecs use different algorithms, but the central principle is to represent important information accurately while reducing the precision or representation of less important information. JPEG divides an image into blocks and applies a discrete cosine transform, producing coefficients associated with different spatial frequencies. Quantisation then reduces the precision of those coefficients, with stronger reduction often applied to higher-frequency components. Modern codecs such as AV1-based AVIF use much more sophisticated prediction and transform systems. The result is a compact representation that reconstructs an approximation of the source image. The decoder does not have access to the exact values that were discarded during encoding.
The principal advantage of lossy compression is its ability to achieve substantially smaller files than many lossless techniques for complex images. Photographs contain large amounts of detailed information, and a lossless algorithm must preserve every distinction even when some are visually insignificant. A lossy codec can instead exploit perceptual redundancy and reduce information that contributes relatively little to the perceived image. This makes lossy compression particularly valuable for web delivery, digital photography, online publishing and large-scale image storage.
Smaller files reduce bandwidth and storage requirements and can improve delivery performance. The trade-off is that every lossy encoding has the potential to change the image, and the changes become increasingly visible as compression becomes more aggressive or when the source contains content that is difficult for the codec to represent efficiently.
Compression artefacts are visible manifestations of information loss. Depending on the codec and settings, artefacts can include blocking, ringing, blurring, mosquito noise, banding, colour shifts, texture loss and loss of fine edges. JPEG is especially known for block artefacts because of its traditional 8 by 8 processing structure. Modern codecs use more sophisticated structures that can produce different artefact patterns, although they are not immune to degradation.
Smooth gradients, text, thin lines and high-contrast edges can expose compression problems more readily than complex natural textures. Perceptual quality is therefore content-dependent. A quality setting that looks excellent for a photograph may be inappropriate for a screenshot containing small text, while a setting that preserves text adequately may produce an unnecessarily large photographic file.
Lossy compression is usually controlled through encoder parameters that influence the amount of quantisation or other information reduction. These parameters are not universally comparable across formats. A “quality 80” setting in one encoder does not necessarily produce the same file size or visual quality as “quality 80” in another. Good encoding workflows evaluate output at the intended display size and compare file size with perceptual quality.
Objective metrics such as PSNR, SSIM and newer perceptual metrics can provide numerical comparisons, but no single metric perfectly captures human visual judgement. Expert workflows may therefore combine objective measurements with visual inspection, particularly when images are used professionally or when small details are important.
Repeated lossy compression can compound degradation. If a JPEG is decoded and then re-encoded as another JPEG, the second encoding operates on an already modified image. New quantisation and coding decisions can introduce additional artefacts, especially around details affected by the first compression. Repeated editing and exporting can therefore progressively reduce quality. A better workflow is to retain a high-quality master, preferably in a lossless or minimally processed format, and generate delivery copies from that source. Some editing applications use non-destructive workflows that preserve the original data and store transformations separately. This allows multiple versions to be generated without repeatedly modifying the source through irreversible compression.
Lossy compression should not be confused with resizing, colour conversion or reducing bit depth, although those operations can also result in information loss. Lossy compression specifically concerns how data is encoded with intentional information reduction to obtain a smaller representation. An image can be resized without using lossy compression, or it can be compressed lossily without changing its dimensions. Similarly, converting a wide-gamut image to a smaller colour space can discard colour information even if the resulting file uses lossless compression. In practical workflows, several such transformations can occur together, so the final quality depends on the complete processing chain rather than on compression alone.
Lossy compression is therefore a controlled form of irreversible information reduction used to obtain substantially smaller representations of complex data. In images, it relies on mathematical transformations, prediction, quantisation and perceptual principles to prioritise visually important information. Its advantages include major reductions in storage and bandwidth, while its disadvantages include possible artefacts and irreversible detail loss. Appropriate use depends on the source content, required quality, target dimensions, codec, encoder settings and number of encoding generations. The key principle is not that lossy compression makes an image “bad”, but that it exchanges exact numerical fidelity for greater compression efficiency, with the acceptable balance determined by the intended application.