iformat.io Logo iformat.io

Image Compression Explained — How to Reduce File Size Without Losing Quality

P
Mar 13, 2026
7 min read
You take a photo on your phone and it's 6 MB. You need to upload it somewhere that only accepts 1 MB. So you compress it, and the file shrinks to 800 KB. But here's the thing most people never think about: what actually happened to those other 5.2 MB of data? Where did it go, and why does the image still look fine? Understanding what happens inside image compression helps you make better decisions about quality, file size, and which format to use. This isn't theoretical — it directly affects how fast your website loads, whether your email attachment gets through, and whether your printed photos look sharp or muddy.

Lossy vs Lossless — The Two Fundamental Approaches

Every image compression method falls into one of two categories. Lossless compression finds patterns in the data and stores them more efficiently, like using shorthand. No pixel data is discarded — you can decompress and get back the exact original file, bit for bit. PNG uses lossless compression. So do TIFF (optionally) and GIF. Lossless compression typically reduces file size by 20-50%, depending on image content.
Lossy compression takes a different approach: it permanently removes data that human eyes are unlikely to notice. JPEG compression, for example, exploits the fact that our eyes are far more sensitive to brightness differences than colour differences. It reduces colour detail more aggressively than brightness detail, and humans typically can't tell the difference. The file gets dramatically smaller — 70-95% reductions are common — but the discarded data is gone forever. You can never recover it.

How JPEG Compression Actually Works

JPEG compression is an engineering marvel that most people take for granted. The process has several stages. First, the image is converted from RGB colour to a different colour model called YCbCr, which separates brightness (luminance) from colour (chrominance). The colour channels are then downsampled — reduced to half or quarter resolution — because your eyes won't notice. Next, the image is divided into 8x8 pixel blocks, and each block goes through a mathematical transformation (DCT — discrete cosine transform) that converts pixel values into frequency components. High-frequency details (sharp edges, noise, fine textures) are then quantized — rounded down or discarded entirely. The more aggressively you quantize, the smaller the file and the more quality you lose.
This is why JPEG compression artefacts appear as blocky patterns and blurry edges — they're the visible result of those 8x8 blocks losing their high-frequency detail. At high quality settings (90-100%), the artefacts are invisible. At medium quality (60-80%), they're detectable if you zoom in but imperceptible at normal viewing. Below 40%, things start looking rough.

PNG vs JPEG — When to Use Each

This choice confuses people, but the rule is straightforward. Use JPEG for photographs and images with complex, continuous tones — landscapes, portraits, product photos. JPEG excels at compressing smooth gradients and natural scenes. Use PNG for graphics with sharp edges, text, logos, screenshots, and anything that needs transparency. PNG's lossless compression preserves hard edges and flat colours perfectly, while JPEG's lossy approach smears them.
A photo saved as PNG might be 8 MB. The same photo as a quality-85 JPEG might be 400 KB — and look identical to the naked eye. But a screenshot with text saved as JPEG shows ugly artefacts around the letters, while the PNG version is crisp. If you're not sure which to use, the image converter lets you try both and compare the results.

The Quality vs File Size Tradeoff

Here's what most people miss about the quality slider: the relationship between quality percentage and file size is not linear. Going from 100% to 90% quality might cut your file size in half while producing virtually no visible difference. Going from 90% to 80% saves another 30-40%. But going from 40% to 30% saves very little additional space while making the image noticeably worse. The sweet spot for most purposes is 75-85% — this is where you get the largest file size reduction with the least visible impact.

Quick Rule of Thumb

Web images: JPEG at 75-85% quality. Email attachments: JPEG at 60-75%. Print: JPEG at 90-100% or use PNG/TIFF. Graphics/logos: Always PNG. Transparency needed: PNG or WebP.

Modern Formats — WebP and AVIF

JPEG was designed in 1992. It's remarkably good for its age, but three decades of research have produced better options. WebP, developed by Google, offers both lossy and lossless compression that's roughly 25-35% more efficient than JPEG and PNG respectively. A photo that's 400 KB as a quality-85 JPEG is typically 280 KB as WebP at equivalent visual quality. WebP also supports transparency (unlike JPEG) and animation (like GIF, but much smaller).
AVIF goes further, achieving roughly 50% smaller files than JPEG at the same quality. It supports HDR, wide colour gamut, and both lossy and lossless modes. The catch is that encoding is slow and browser support, while growing quickly, isn't quite universal yet. For most people in 2026, WebP is the practical choice — it's supported by every modern browser and offers meaningful improvements over JPEG. You can compress your images into these modern formats and see the difference for yourself.
The bottom line: compression isn't magic — it's math. Understanding the trade-offs between lossy and lossless, knowing when to use JPEG vs PNG, and picking the right quality level for your use case lets you make smarter decisions about every image you work with. The difference between a well-compressed image and a poorly-compressed one can be 10x in file size with no visible quality difference.
Browse All Posts