JPEG Compression Explained: Quality vs File Size
JPEG is the most widely used image format in the world, yet most people who work with JPEG files daily do not understand how the compression actually works or what the quality setting means. This guide explains the mechanics of JPEG compression and gives you concrete guidance on choosing the right quality setting for every scenario.
How JPEG Compression Works
JPEG uses a process called discrete cosine transform (DCT) compression. Without going into the mathematics, the key concept is this: JPEG divides the image into small 8×8 pixel blocks, then encodes each block by describing the dominant patterns of colour and brightness rather than storing each pixel individually.
The compression is lossy, meaning it permanently discards information that is considered less perceptible to the human eye. Specifically, JPEG is more aggressive about preserving brightness information (luminance) than colour information (chrominance), because the human eye is more sensitive to contrast and brightness differences than to subtle colour variations.
When you lower the JPEG quality setting, you allow the compression to discard more information from each 8×8 block. This produces a smaller file, but introduces visible artefacts — particularly the characteristic blocky distortions and colour smearing that appear in heavily compressed JPEG images.
What the Quality Scale Means
Most JPEG encoders use a quality scale from 1 to 100. This is not a linear relationship— the quality-to-file-size curve is not uniform. Changes in the 70–90 range have a large impact on file size with minimal visual difference. Changes below 60 are visually significant.
| Quality | Relative File Size | Visual Quality | Best For |
|---|---|---|---|
| 95–100 | ~100% (baseline) | Indistinguishable from original | Archival, print |
| 85–90 | ~50% smaller | Excellent — no visible artefacts | Professional photography, product images |
| 75–80 | ~70% smaller | Very good — imperceptible difference on screen | Web images, social media |
| 65–70 | ~80% smaller | Good — slight softening in fine detail | Thumbnails, fast-loading web pages |
| 50–60 | ~87% smaller | Acceptable — visible in high-contrast areas | Form uploads with strict size limits |
| Below 50 | ~90%+ smaller | Poor — clear blocky artefacts | Not recommended for most uses |
When JPEG Compression Hurts More Than It Helps
JPEG is not the right format for all images, and compressing the wrong type of image can produce terrible results even at high quality settings:
- Text and sharp edges
- JPEG smears the boundaries between text characters and background. Screenshots of text, diagrams, and UI elements look awful as JPEG. Use PNG or WebP.
- Images with large flat colour areas
- Solid colour backgrounds develop visible bands and colour shifts. Use PNG for graphics with uniform colour regions.
- Images you will re-edit
- Every time you save a JPEG, you lose more quality. Save working copies as PNG or WebP lossless, and export to JPEG only for the final version.
- Already-compressed JPEGs
- Re-compressing a JPEG introduces generation loss — each compression cycle adds more artefacts. Only compress from the original source when possible.
The Right Quality Setting for Common Use Cases
Website hero images and product photos → Quality 75–80
Invisible quality loss on screen, 60–70% smaller than original.
Social media profile and cover photos → Quality 80–85
Platforms re-compress uploaded images anyway — start with good quality.
Email attachments → Quality 70–75
Keeps files small enough to send. Quality is sufficient for preview.
Passport and visa form uploads → Quality 60–70
Needed to hit strict size limits (20–50 KB). Faces remain identifiable.
Print (home printing) → Quality 90–95
Printed at 300 DPI, artefacts become visible at low quality.
Archival and professional photography → Quality 95–100
Keep the highest quality — storage is cheap.