FreeImgKit

February 14, 2025  ·  7 min read

The Beginner's Guide to Image Compression

What is image compression, how does it work, and how do you use it without making your images look bad? Everything a beginner needs to know.

If you've ever noticed that photos taken on a smartphone are enormous raw files but photos shared online are much smaller, you've already encountered image compression in action. This guide explains what's actually happening, why it matters, and how to use it confidently.

What is image compression?

Image compression is the process of reducing the data required to represent an image. A raw 12-megapixel photo contains 12 million pixels, each described by three colour values (red, green, blue) stored as 8-bit numbers. That's 36 megabytes of raw data per photo. Compression algorithms find patterns and redundancies in this data and encode them more efficiently.

Lossy vs lossless compression

Lossless compression

Lossless compression reduces file size without discarding any image data. The original image can be perfectly reconstructed from the compressed file. PNG uses lossless compression. Typical lossless compression ratios for photographs are modest — 2:1 to 3:1.

Lossy compression

Lossy compression achieves much smaller files by permanently discarding some image data. The key insight that makes this workable is that human vision has limitations — we're much better at detecting brightness differences than colour differences, and we're more sensitive to gradual changes than sharp ones. JPEG and WebP exploit these perceptual limits to discard data we can't see.

A typical JPEG compressed to 80% quality achieves a 10:1 to 15:1 compression ratio compared to the raw data — reducing a 10 MB file to 700 KB to 1 MB — with no perceptible quality difference in most photographs.

Understanding the quality slider

Image compressors typically offer a quality setting between 0 and 100. This isn't a simple percentage of 'how much quality you keep' — it maps to a set of internal compression parameters. Here's a practical guide to what different quality levels mean:

  • 90–100%: Very high quality, minimal compression. File sizes are large. Use for archiving or print output.
  • 80–89%: High quality, visible compression only under close inspection. Good for professional web use.
  • 70–79%: Good quality, small artefacts on close inspection. Ideal for most web images.
  • 60–69%: Acceptable quality for thumbnails or background images. Clear artefacts on close inspection.
  • Below 60%: Visible degradation. Use only when file size is the absolute priority.

Why JPEG compression artefacts appear

JPEG divides an image into 8×8 pixel blocks and compresses each block independently. At high quality settings, the blocks are compressed minimally and blend together invisibly. At low quality settings, the blocks become visible as a blocky, smeared pattern — particularly around sharp edges and areas of fine detail. This is called 'blocking artefact' and is the signature of over-compressed JPEG images.

The right compression workflow

  1. Start with the highest quality source you have — never compress an already-compressed image as a source.
  2. Resize the image to the actual dimensions it will be displayed at.
  3. Choose the right format: WebP for web, JPEG for maximum compatibility, PNG for transparency or lossless.
  4. Set quality to 80% and evaluate the result visually.
  5. If quality looks fine, try 75% for an even smaller file.
  6. Only go below 70% if file size is the hard priority and you've confirmed the artefacts are acceptable.

Does compression affect resolution?

No. Compression changes how the pixel data is stored, not the number of pixels. A 1920×1080 image compressed from 5 MB to 200 KB is still 1920×1080 pixels. The only way to change the pixel count is to resize the image — which is a separate operation.