What compression actually means
A digital image is fundamentally a grid of pixels. Each pixel has a color value — typically stored as three numbers representing the red, green, and blue channels. An uncompressed 12-megapixel photo stores 12 million pixels, each with three 8-bit color values, totalling around 36MB of raw data.
Compression algorithms look for patterns and redundancies in that data and encode them more efficiently. A sky that's mostly the same shade of blue doesn't need to store that value 400,000 times. Instead, it can say 'repeat this color across this region' and store it once.
How aggressively an algorithm exploits these patterns — and whether it discards information to do so — is what separates the different compression types.
Lossy compression — trading quality for size
JPG (or JPEG) is the most common lossy format. It compresses images by grouping pixels into 8×8 blocks and applying a mathematical transformation called Discrete Cosine Transform (DCT) to each block. The algorithm then discards fine detail that human vision is least sensitive to, particularly in areas of high-frequency texture.
The 'quality' setting in a JPG compressor controls how much detail is discarded. At quality 100, almost nothing is thrown away and file sizes stay large. At quality 60, significant detail is removed but the image often looks acceptable to most viewers. The sweet spot for web images is usually 75–85%.
Once data is discarded in a lossy format, it's gone permanently. Re-editing and re-saving a JPG in a photo editor compounds this quality loss each time. Always work from the original if you need to make edits.
Lossless compression — smaller files, no quality cost
PNG uses lossless compression. Every pixel value is preserved exactly. The algorithm finds patterns in the data (like runs of identical colors) and encodes them more efficiently, but nothing is thrown away.
Lossless compression produces larger files than lossy for photographs, but it's ideal for anything with sharp edges, flat colors, or text — like screenshots, logos, and diagrams. JPG compression on these creates visible blocky artifacts (called ringing or mosquito noise) around high-contrast edges.
WebP supports both lossy and lossless modes. The lossless WebP format typically produces files 20–30% smaller than equivalent PNG files.
Why WebP is worth switching to
Google developed WebP specifically to be a better format for the web. Its lossy mode is based on VP8 video compression and produces files roughly 25–35% smaller than JPG at the same visual quality. Its lossless mode beats PNG by a similar margin.
WebP also supports transparency (like PNG) and animation (like GIF but with better compression). In 2026, browser support is essentially universal — all major browsers on all platforms support it.
The practical implication: if you're preparing images for a website, converting your JPGs to WebP will typically shave 25–35% off your total image payload with no visible quality difference.
What 'quality' settings actually do in practice
The quality slider in a compressor isn't a percentage of the original quality. It's a control over how aggressively the compression algorithm discards information. Different compressors implement this scale differently, so quality 80 in one tool isn't exactly equivalent to quality 80 in another.
As a practical guide: 85–95 is very high quality with modest compression. 70–85 is the standard range for web use — files are small and the quality difference is barely noticeable. Below 60 you'll start seeing obvious artifacts in most photos. For thumbnails and background images, 50–65 is fine.
The most useful thing to do is look at the actual output rather than rely on numbers. Use the before/after preview in the compressor to find the lowest quality setting where the image still looks acceptable for your use case.
