To make an image lighter, should you lower the resolution or push the compression?

The same photo of a large pipe organ, split in two: the left half heavily compressed and degraded (blocks and blur), the right half in high quality, sharp.
Eco-design
Date18 June 2026
Reading time9 minutes
AuthorSami Lini

Intro

On 10 RAW photos, 4 formats and 6 resolutions, we measured perceived quality. JPEG XL gives the best trade-off. At acceptable or high quality, lowering the resolution cuts file size as much as changing format.

In 2024, after an eco-design training session with Temesis (opens in new window), we hacked together a small Python script to answer a question our clients were asking more and more often: to make an image lighter, what matters most, the resolution, the compression rate or the format? We put out some curves and shared the code, warning that we weren’t compression experts. We even wondered whether we were comparing apples and oranges.

We ran the test again, this time with a measure of perceived quality, the one that tells you whether the eye can see the difference from the original. For a photo, the best balance between quality and file size comes from JPEG XL at distance 0.7 (this encoder’s quality setting), on an image reduced to 40% of the size it is displayed at, then enlarged by the browser. AVIF comes just behind, but WebP produces larger files than JPEG as soon as you aim for high quality. And at acceptable or high quality, lowering the resolution cuts file size as much as changing format, sometimes more.

Why run the test again

The 2024 script encoded the images and measured their size correctly. It compared formats all set to “quality 80”, in the belief that we were comparing them at equal quality. Except that this 80 doesn’t mean the same thing from one format to another.

A JPEG at “quality 80” and a WebP at “quality 80” don’t give two images of equivalent quality, because this 80 is a scale internal to each encoder, a bit like two marks out of 20 worked out with different marking schemes. The two settings just carry the same number.

And we only looked at file size. A file half the size that smudges all over is still a damaged image: without a measure of what the eye sees, we could say a format made things “smaller”, never that it made them “better”. All on a handful of photos, far too few to generalise anything.

How we went about it this time

We started again from raw photos. Our internal photo library holds 15,314 RAW files accumulated since 2016. We drew 10 at random, one per year from 2016 to 2025. The random generator is fixed, so the same draw can be replayed. Above all, we didn’t pick photos that suit our conclusions.

Each RAW is decoded only once into an uncompressed image. That image serves both as the starting point for the encodings and as the original against which the damage is measured. Then we crossed everything: 4 formats (JPEG, WebP, AVIF, JPEG XL), 6 resolutions (10, 25, 40, 55, 75 and 100%) and 5 or 6 compression settings per format (6 for JPEG, 5 for the others). That makes 1,260 encodings. The encoder settings are written down in black and white, so that someone else can run the same thing again and get the same numbers.

The difference from 2024 is the perceived quality measure. It’s called SSIMULACRA2, and Jon Sneyers developed it at Cloudinary in 2022 (he is also one of the authors of JPEG XL). It is calibrated on human judgements. Its score goes up to 90 and above when the difference from the original becomes invisible. A score of 70 corresponds to good quality and 50 to medium quality. A heavily degraded image can drop below zero.

So we stopped comparing “at equal setting”. For each encoding we record its file size and its perceived quality, then we look, for a target quality level, at which format gives the lightest file. As our settings rarely land exactly on the target score, we interpolate, for each photo, between the two best trade-offs on either side of it, then take the median of the 10 photos. That’s the question we wanted to ask in 2024.

AVIF and JPEG XL ahead, WebP disappointing at high quality

Each curve is a format’s frontier: the best quality it reaches for a given file size. The star marks its sweet spot, the point beyond which each extra KB adds almost no quality.

Best quality per KBPareto frontier by format (median of the 10 photos) on the file size (log scale) and perceived quality axes. The star marks the sweet spot, the best quality per KB.
View the data
FormatSweet spotFile sizeQualityFile size for quality 70
JPEGq90, 40%463 KB66700 KB
WEBPq100, 40%946 KB72773 KB
AVIFq85, 40%354 KB65586 KB
JPEG XLd1, 40%369 KB67435 KB

Here is the file size needed to reach each quality level (median of the 10 photos), when we also allow ourselves to play with the resolution. Note that these KB are for the whole photo, 15 to 24 million pixels (6,024 × 4,020 for most of them). An image displayed smaller on a web page is much smaller, so we advise you to look at the gaps between formats rather than at the KB themselves.

File size needed for each quality levelMedian of the 10 photos, by row: green = lightest format, red = heaviest
File size needed for each quality level : Median of the 10 photos, by row: green = lightest format, red = heaviest
Target quality JPEGWebPAVIFJPEG XL
Acceptable (score 60) 361 KB 349 KB 245 KB 257 KB
High (score 70) 700 KB 773 KB 586 KB 435 KB
Very high (score 80) 2202 KB 2554 KB 1931 KB 1395 KB

AVIF and JPEG XL do clearly better than JPEG and WebP. Between the two, AVIF wins when you’re trying to cut file size hard, and JPEG XL pulls ahead as soon as you move up to high quality. At score 70, switching from JPEG to JPEG XL cuts file size by nearly 40%, as a median over our 10 photos.

WebP surprised us. We imagined it ahead of JPEG everywhere. It only clearly beats it at low quality (files a quarter smaller around score 40), draws level around 60 and 65, then produces larger files than JPEG from 70 upwards. For light web images, it remains a good choice: it’s the modern format best supported by browsers, but at high fidelity AVIF and JPEG XL do better.

Resolution or compression?

That was the starting question, the one we couldn’t find an answer to in the literature in 2024. And the answer is that it depends on the quality level you want to get.

Before reading the charts, you need to know that the percentages are relative to the display size. We resized each photo, then looked at it enlarged to its original size, like a browser stretching a small image into a large frame. So “55%” means encoding at 55% of the size the image will be displayed at.

For each format, here is the score obtained by compression setting, with one curve per encoding resolution. You can read both settings at once: following a curve means pushing the compression, moving from one curve to another means changing the resolution.

JPEGJPEG: perceived quality (SSIMULACRA2, median of the 10 photos) by compression setting (quality), one curve per encoding resolution.
View the data
Resolutionquality 30quality 50quality 65quality 80quality 90quality 95
10%-38-27-20-12-32
25%-11424374955
40%223948586671
55%345057657276
75%425662707781
100%415967778387
WebPWebP: perceived quality (SSIMULACRA2, median of the 10 photos) by compression setting (quality), one curve per encoding resolution.
View the data
Resolutionquality 45quality 65quality 80quality 90quality 100
10%-31-23-15-26
25%210284859
40%2133455972
55%3343546478
75%4353607283
100%5359667988
AVIFAVIF: perceived quality (SSIMULACRA2, median of the 10 photos) by compression setting (quality), one curve per encoding resolution.
View the data
Resolutionquality 40quality 55quality 70quality 85quality 95
10%-31-15-526
25%1027425361
40%2948586573
55%4257637279
75%5362707884
100%6069778489
JPEG XLJPEG XL: perceived quality (SSIMULACRA2, median of the 10 photos) by compression setting (distance), one curve per encoding resolution. For JPEG XL, a smaller distance means less compression.
View the data
Resolutiondistance 0.7distance 1distance 1.5distance 2.5distance 4
10%51-4-13-24
25%5751432615
40%7167625036
55%7773686150
75%8279746560
100%8784817364

The lower the resolution, the lower the best score you can reach, in steps. At full resolution, it rises to around 87 to 89 depending on the format. At 40% of display size, it tops out between 71 and 74, which is still enough for high quality, but very high quality (score 80) requires keeping at least 75%. Below 25%, the image collapses. The charts give each step, format by format.

Lowering the resolution: file sizeFile size by encoding resolution, expressed as a percentage of display size, at a high-quality setting.
View the data
Format (KB)10%25%40%55%75%100%
JPEG56311744140627725038
WEBP57339946188035656644
AVIF53311855173832906147
JPEG XL42215527103117893092

That leaves the question of what pays off most, lowering the resolution or pushing the compression. We compared, at identical perceived quality, the file size when you keep full definition and the file size when you accept lowering it.

File size saved by accepting a lower resolution, at identical perceived quality, by format
FormatAcceptable qualityHigh qualityVery high quality
JPEG−48%−38%−2%
WebP−27%−35%−19%
AVIF−15%−17%−7%
JPEG XL−42%−28%−2%

At acceptable or high quality, resizing saves a lot, especially with JPEG: almost half the file size at acceptable quality. At very high quality, the saving drops to a few per cent (except for WebP), because at that level of demand you need every pixel. So on a thumbnail or an illustration image, start with the resolution. On a photo you want to look good at a large size, work on the format and the compression.

The best balance between quality and file size

Across all combinations, there’s no absolute optimum, since each added KB still buys a little more quality. The curve does have a knee, though. On our measurements, it falls on JPEG XL at distance 0.7, encoded at 40% of display size: 527 KB for the whole photo, with a score of 71, just above the high-quality threshold. Beyond it, doubling the file size earns almost half as many points as before.

We found this knee with the same method as the stars in the first chart, on the frontier shared by the four formats. Above score 50, this frontier is made up only of AVIF and JPEG XL: JPEG and WebP never appear on it.

The knee of the shared frontierBest perceived quality reachable for each file size, across all formats, settings and resolutions (median cells of the 10 photos). The star marks the knee.
View the data
FormatSettingResolutionFile size (KB)Score
AVIFquality 5555%16857
AVIFquality 7040%17758
JPEG XLdistance 1.540%23762
JPEG XLdistance 140%36967
JPEG XL (knee)distance 0.740%52771
JPEG XLdistance 0.755%103177
JPEG XLdistance 1.5100%142081
JPEG XLdistance 1100%209284
JPEG XLdistance 0.7100%309287
AVIFquality 95100%614789
Quality points gained when doubling the file size, before and after the knee
File size rangePoints gained when doubling the file size
From 168 to 527 KB (before the knee)+8.7
From 527 to 6147 KB (after the knee)+4.9

The lightest combination for each quality level

For each quality level and each format, here is the lightest combination of resolution and setting among those we tested, as a median of the 10 photos for each combination. JPEG XL wins at every level. The table at the start puts AVIF ahead at acceptable quality because it interpolates between two tested settings, whereas this one only keeps settings you can apply as they are.

Lightest tested combination by quality level and by format
Target qualityFormatSettingResolutionFile sizeScore obtained
Acceptable (score 60)JPEG XLdistance 2.555%231 KB61
Acceptable (score 60)AVIFquality 5575%293 KB62
Acceptable (score 60)JPEGquality 9040%463 KB66
Acceptable (score 60)WebPquality 9055%598 KB64
High (score 70)JPEG XLdistance 0.740%527 KB71
High (score 70)AVIFquality 8555%737 KB72
High (score 70)JPEGquality 9540%744 KB71
High (score 70)WebPquality 10040%946 KB72
Very high (score 80)JPEG XLdistance 1.5100%1420 KB81
Very high (score 80)JPEGquality 9575%2772 KB81
Very high (score 80)AVIFquality 85100%2850 KB84
Very high (score 80)WebPquality 10075%3565 KB83

Why some photos produce larger files than others

We also wondered what, in a photo, predicts its file size. Our intuition said the histogram, the distribution of tones. We checked it on all four formats.

The more detail a photo has, the larger its file, whatever the codecFor each photo and each codec, edge density (the detail) against file size at fixed quality (bpp at SSIMULACRA2 = 70, full resolution). The trend lines rise for all four codecs.
View the data
CodecPhotos (n)Spearman correlation (detail / file size)
JPEG10+0.96
WEBP10+0.95
AVIF9+0.93
JPEG XL6+0.89

The histogram is a poor predictor of file size. Its link with file size varies a lot from one format to another (Spearman correlation from 0.14 to 0.66). The amount of detail, measured by edge density, predicts it much better, with a correlation of 0.89 to 0.96 depending on the format: the more an image teems with fine textures (foliage, crowds), the larger its file at equal quality. A sky or a portrait on a blurred background compresses much better, whatever the shape of its histogram.

Not all these figures are based on 10 photos. We only have 6 for JPEG XL and 9 for AVIF, because the least detailed photos already exceed score 70 at the most compressed setting we tested: we can’t measure their file size at that score. But to guess whether an image will make a large file, we look at its texture rather than its histogram.

The limits of the test

Our 10 photos come from three Canon cameras: two DSLRs (EOS 80D and EOS 500D) and a compact (PowerShot G1 X Mark III). The corpus is homogeneous, so easy to reproduce, but it says nothing about screenshots, flat-colour illustrations or images containing text, which compress very differently. For those, you’d need a dedicated corpus.

SSIMULACRA2 remains an automatic measure: it lets us rank 1,260 encodings, but it doesn’t replace a look at the final image. Our figures also depend on the encoders, their versions and the settings we fixed: other parameters would shift the curves. Finally, our settings top out around score 90, so we don’t measure the “strictly indistinguishable”, which costs even more and which you rarely aim for on the web.

For your own images

Use AVIF or JPEG XL as soon as your audience’s browsers allow it, with WebP as a fallback. Before even choosing the format, resize to the actual display size: it’s the simplest and biggest saving at acceptable or high quality. And match your requirement to the use: a background image doesn’t need near-lossless, which is the heaviest level in our measurements.

We’ve packaged it all up so you can test it yourself, as is, like the first time. There’s no reason it should break anything on your side, but if it did, you’re grown-ups and responsible for it. And if you think we’re still comparing apples and oranges, write to us and we’ll adjust.

This article was written with the help of AI, under the supervision of the team (see our AI use statement).

Want to discuss your project?

Everyone talks about user experience, service design, ergonomics… It’s not very clear, but you’d like to explore all that or get better at it.

Contact us