Lossy compression is a data reduction technique that permanently discards certain information from an image or media file in order to produce a significantly smaller file size. Unlike lossless compression, which preserves every original bit of data, lossy compression makes a deliberate trade-off: some quality is sacrificed in exchange for a smaller, faster-loading file.
The core idea behind lossy compression is that human perception has limits. When viewing a photograph, for example, the eye is less sensitive to subtle variations in color or fine high-frequency detail than it is to overall shapes and contrast. Lossy algorithms exploit this by identifying and removing the data that viewers are least likely to notice. The result is a file that looks nearly identical to the original at moderate compression levels, but which cannot be restored to its exact original state once compressed. The discarded data is gone permanently.
JPEG is the most widely recognized lossy image format. When you save a JPEG at a lower quality setting, the encoder applies a mathematical process called discrete cosine transform to divide the image into small blocks and approximate their color values, discarding fine detail in the process. The more aggressively the file is compressed, the more visible the artifacts become - typically appearing as blocky patches or blurring around sharp edges, a phenomenon commonly referred to as compression artifacts.
Modern formats such as WebP and AVIF also support lossy compression, but use more sophisticated encoding algorithms that achieve better visual quality at equivalent or smaller file sizes compared to JPEG. This makes them increasingly preferred for web delivery, where minimizing page weight directly affects load time and user experience.
For web developers and SEO professionals, understanding lossy compression is important because image files are often the largest assets on a page. Serving appropriately compressed images reduces page weight, improves Core Web Vitals scores - particularly Largest Contentful Paint - and contributes to faster load times across all devices and connection speeds.
Choosing the right compression level involves balancing visual fidelity against file size. A quality setting that is too low produces noticeable degradation; one that is too high yields little size benefit. Most image optimization workflows involve testing multiple quality levels to find the point where the file is as small as possible without visible quality loss to the average viewer. This process is sometimes called perceptual optimization, since it is guided by how humans perceive image quality rather than by raw data accuracy.
When repeated re-saving of a lossy file is unavoidable - for instance, during iterative editing - quality degrades further with each save cycle, a phenomenon known as generation loss. For this reason, original source files are best preserved in a lossless or raw format, with lossy compression applied only at the final export stage.