Format · JPEG

The photograph
default since 1992

JPEG is a lossy, block-based format built on a frequency transform. It is still the safest way to hand someone a photograph — and still the worst way to store a screenshot.

Lossy · 8×8 DCT · No alpha · Universal
8×8 transform block1 quality dial0 alpha support
Inside

Blocks, frequencies, and one rounding step

JPEG converts colour, subsamples it, transforms 8×8 blocks into frequencies, and rounds the small ones to zero. Everything you dislike about JPEG traces to that last step.

Reference

What the format actually stores

A JPEG file is not a picture with reduced detail. It is a set of quantised frequency coefficients per 8×8 block, arranged so a decoder can rebuild an approximation of the original pixels. The transform is a discrete cosine transform, and it is what makes the format work: smooth areas produce one large coefficient and dozens of near-zero ones, which compress to almost nothing.

Chroma is handled separately. RGB is converted to luma and two colour-difference channels, and the colour channels are usually stored at half resolution — 4:2:0. That halves the colour data before the transform even begins, and it is the reason saturated reds and thin coloured type suffer first as quality drops.

Quality is a divisor, not a percentage

The quality setting scales a quantisation table. It is not a measure of anything absolute, and the same number means different things in different encoders — a fact that makes cross-tool comparisons unreliable. What is portable is the shape of the curve: most of the byte saving happens between 75 and 90, and the last five points toward 100 buy almost nothing visible.

The full pipeline, stage by stage, is in how image compression works.

Pipeline

Baseline and progressive

Two scan orders, same codec. Baseline writes the image top to bottom; progressive writes it in successive refinements.

01 01
Colour transform

RGB becomes Y, Cb and Cr. Luma carries the detail the eye is good at resolving.

02 02
Subsampling

Cb and Cr are stored at half resolution by default — an immediate 50% saving on colour data.

03 03
Block transform

Each 8×8 block of each channel becomes 64 coefficients. Smooth blocks concentrate energy top-left.

04 04
Quantise

Coefficients are divided and rounded. High frequencies become zero. This is the irreversible step.

05 05
Entropy code

Run-length plus Huffman. Progressive reorders the same coefficients across several scans.

Progressive JPEG often reads as faster on slow connections: a blurry full frame arrives before sharp detail does.

Measured

What quality actually costs

From the site benchmark run over 456 Wikimedia JPEGs with real vips at the balanced setting.

QualityByte saving vs originalWhat you notice
90–95SmallNothing, on most photographs
85≈58% averageNothing at 100% view
75MoreTexture and fine detail soften
60Much moreVisible ringing around edges

The per-file numbers, method and peak savings are on benchmarks.

Suits

Where JPEG still wins

JPEG is not obsolete. It wins on two axes that no modern format beats.

Universal decode Every browser, every office suite, every thumbnailer, every operating system since the 1990s.
Encode speed Hardware and software JPEG encoding is measured in milliseconds per megapixel; AVIF is not.
Photographic content The DCT model fits smooth, continuous-tone images, which is exactly what a camera produces.
Graceful degradation Truncated or corrupted files often still decode partially, unlike a broken AVIF.
Limits

Where JPEG breaks down

Three content classes defeat the format regardless of quality setting.

Text and UI

Glyph edges are exactly the high-frequency content JPEG discards. Text fuzzes and grows halos even at high quality. Use PNG.

Hard edges and line art

Every sharp boundary rings. Flat illustrations accumulate 8×8 artefacts across their interior.

Transparency

JPEG has no alpha channel at all. A cut-out must live in PNG, WebP or AVIF.

Compare

JPEG next to the alternatives

JPEG is the baseline every other format is measured against — usually at 25–50% larger files for the same look.

Image formats compared puts JPEG, PNG, WebP and AVIF in one table with support and capability columns. For the tradeoff itself, lossy vs lossless explains what you give up by choosing a lossy codec at all.

Converting JPEG to WebP typically saves another 25–35% at the same visual quality — see JPG to WebP.

FAQ

JPEG — FAQ

Is JPEG the same as JPG?

Yes. Same format, two extensions — a historical limit of three characters in early Windows filesystems.

Does quality 100 mean lossless?

No. It still quantises, just with a finer table. Exact pixels require a lossless format.

Why does my JPEG look worse after editing and saving?

Each save re-encodes and adds a generation of quantisation. Edit from the original, or work in a lossless intermediate.

Can JPEG store a colour profile?

Yes — an ICC profile can be embedded. Stripping it during compression can shift colours, which is why profile handling matters.

What quality should I ship?

85 is a sound default for photographs. Go lower only after you have fixed dimensions and format.

JPEG · mozjpeg

Compress JPEGs where they live

Quality 40–95, keep format or convert, batch a folder without uploading a byte.

Windows 10/11 · Offline · Free