A size against SSIM curve for JPEG, WebP and AVIF measured on eight 1024 pixel PNG files from this gallery at quality 40 through 90

Mean encoded size in KB on the horizontal axis against mean SSIM on the vertical, with the quality setting labelled at each point. Further left and higher up is better. Chart generated from the measurement run described below.

AVIF Cost 35 Percent Fewer Bytes Than WebP At The Same Score, And Encoded Faster Doing It

Everyone has heard that AVIF is smaller and slower. The first half is measured here at 35 percent smaller across the whole curve. The second half did not survive the test: against WebP on its best compression setting, AVIF was the faster encoder.

Published September 4, 2026 · RealAIGirls · About a 6 minute read

Share on X Share on Facebook Share on Reddit

There are two numbers in every codec argument and most guides only quote one of them. Everybody knows AVIF makes smaller files. The reason nobody uses it is the second number, encode time, and the received wisdom is that AVIF is far too slow to bother with for a gallery.

So this run measured both, on the same files, in the same process, with a stopwatch around the encoder.

The Setup

Eight PNG files from this gallery, each capped at 1024 pixels on the long edge with Lanczos resampling. Every one is a PNG, so the reference has never been through a lossy pass and nothing is being scored against an already damaged original.

Each file was encoded three ways, JPEG with optimize on, WebP at method 6, and AVIF at speed 6, at quality 40, 50, 60, 70, 80 and 90. That is 144 encodes. Each result was decoded and scored with SSIM against the original on the luma channel, and the encode call itself was timed.

The Whole Table

CodecQualityMean sizeMean SSIMMean encode
AVIF4027.5 KB0.954450.314 s
AVIF5039.8 KB0.968870.371 s
AVIF6056.2 KB0.977510.412 s
AVIF7077.3 KB0.982940.436 s
AVIF80105.5 KB0.987300.427 s
AVIF90159.9 KB0.992400.497 s
WebP4041.0 KB0.952090.509 s
WebP5046.6 KB0.957530.623 s
WebP6052.5 KB0.962260.601 s
WebP7059.1 KB0.966230.775 s
WebP8076.0 KB0.974140.683 s
WebP90128.8 KB0.984970.679 s
JPEG4065.0 KB0.952540.022 s
JPEG5074.8 KB0.959810.021 s
JPEG6085.1 KB0.965500.021 s
JPEG70100.9 KB0.971880.022 s
JPEG80126.5 KB0.978940.027 s
JPEG90187.1 KB0.987380.040 s

The two bolded rows are the comparison that matters. AVIF at quality 60 produced a smaller file and a better score than WebP at quality 80. 56.2 KB against 76.0, and 0.97751 against 0.97414. Not a trade, a straight win on both axes.

Matched At The Score, Not At The Setting

Comparing quality numbers across codecs is meaningless, because quality 80 means a different thing in each encoder. The honest comparison holds the SSIM fixed and asks what it cost. Interpolating along each curve:

TargetWebPAVIF for the same scoreJPEG for the same score
SSIM 0.9575346.6 KB (q50)30.1 KB, 35.4% less71.7 KB, 53.9% more
SSIM 0.9622652.5 KB (q60)34.2 KB, 34.9% less79.2 KB, 50.9% more
SSIM 0.9662359.1 KB (q70)37.6 KB, 36.4% less86.9 KB, 47.0% more
SSIM 0.9741476.0 KB (q80)49.8 KB, 34.5% less109.1 KB, 43.6% more
SSIM 0.98497128.8 KB (q90)90.5 KB, 29.7% less169.9 KB, 31.9% more

The saving is remarkably flat. Between SSIM 0.957 and 0.974 AVIF costs 34 to 36 percent fewer bytes than WebP at the identical score, every time. It narrows to 29.7 percent only at the top of the range, where every codec is spending bytes on detail nobody can see.

JPEG is the other end of the same ruler. At every matched score it costs 32 to 54 percent more than WebP, which is the reason the WebP advice everyone repeats was correct in the first place. It is just no longer the best available answer.

The Part That Was Supposed To Be A Problem

Here is the finding that changed the headline. Mean encode time per file across the six quality settings:

AVIF at speed 6: 0.41 seconds.
WebP at method 6: 0.65 seconds.
JPEG with optimize: 0.026 seconds.

AVIF was 36 percent faster than WebP on this run, at every quality level, without exception. The slowest AVIF encode in the table, 0.497 seconds at quality 90, is faster than the fastest WebP encode, 0.509 seconds at quality 40.

That result deserves a caveat rather than a victory lap, and the caveat is the settings. WebP method 6 is its slowest and most thorough mode, and AVIF speed 6 is a middle setting rather than its most thorough one. A gallery running WebP at method 4 would close most of that gap. What the numbers do rule out is the claim that AVIF is categorically too slow to consider, at least at the settings a real pipeline would use.

JPEG remains sixteen times faster than either of them and it is not close. If encode time genuinely is the constraint, that is the answer, and the price is roughly half again as many bytes.

What To Actually Do With This

If you are serving WebP at quality 80 today, which is the standard advice, AVIF at quality 60 is the direct replacement. Smaller file, higher score, faster encode. On a gallery of a thousand images that is roughly twenty megabytes of transfer per full crawl that stops existing.

Keep a WebP fallback in the picture element. AVIF support is wide now but it is not universal, and a fallback costs nothing but storage.

Do not push AVIF to quality 90 out of caution. It costs 159.9 KB for an SSIM of 0.99240 against 56.2 KB for 0.97751, which is nearly three times the bytes for a difference no viewer will find without a difference blend and a magnifier.

The Numbers, Plainly

Eight files, eighteen encodes each, 144 files scored. Pillow 12 with libwebp at method 6, the built in AVIF encoder at speed 6, and JPEG with optimize enabled. SSIM computed on the luma channel with an 11 tap Gaussian window at sigma 1.5 and the standard stabilisers. Every original is a PNG, so there is no prior lossy pass to muddy the reference. Encode timings are wall clock around the save call on one machine with nothing else running, and they are indicative rather than a benchmark. The files are the ones in this gallery, which means the result describes AI art with soft backgrounds and sharp faces, and might not hold for a page full of screenshots or line art.