Skip to main content

Same quality, fewer bytes: JPEG vs WebP vs AVIF vs JPEG XL

We encoded 86 images at 14 quality settings with four formats, scored every file with SSIMULACRA2, and compared the bytes each format needs to look the same.

Images
86
Files measured
9,632
Metric
SSIMULACRA2
Measured
2026-10-22

Four files that look the same

Each format's quality setting was searched until the whole image scored as close to SSIMULACRA2 70 as it could. The crops below are the decoded pixels at 1:1. The difference is in the file size.

Original crop of two macaws, Kodak image 23, lossless source
Original PNG 544.5 KB lossless source
JPEG crop of two macaws, Kodak image 23, decoded from a 26.9 KB file
JPEG 26.9 KB score 69.6 · q67
WebP crop of two macaws, Kodak image 23, decoded from a 24.8 KB file
WebP 24.8 KB score 70.1 · q78
AVIF crop of two macaws, Kodak image 23, decoded from a 17.5 KB file
AVIF 17.5 KB score 70.4 · q50
JPEG XL crop of two macaws, Kodak image 23, decoded from a 18.7 KB file
JPEG XL 18.7 KB score 70.2 · q60

Kodak image 23, 220 × 220 crop. Sizes are for the whole 768 × 512 file. The crops are lossless WebP, served without re-encoding.

How much smaller, across the corpus

Median per-image file size against mozjpeg at the same score. Pick the content and the quality you ship.

JPEG sharp mozjpeg, 4:2:0
baseline 72 of 74
WebP cwebp -m 6
7% smaller 73 of 74
AVIF avifenc (libaom) -s 6
31% smaller 73 of 74
JPEG XL cjxl -e 7
23% smaller 72 of 74

Bar length is the median file size, with JPEG as 100%. A format shows n/a when fewer than half the images reached the score at the highest setting tested.

What the numbers say

  1. AVIF needed the fewest bytes on photos at high quality: 31% smaller than mozjpeg at score 70. JPEG XL came out 23% smaller.
  2. WebP saved little on photos (7% smaller), but it was 37% smaller on screenshots, where AVIF was 50% smaller.
  3. Visually lossless (score 90) is hard for 4:2:0 formats: mozjpeg reached it on 26 of 74 photos and WebP on 9 of 74, against 71 of 74 for AVIF and 68 of 74 for JPEG XL.
  4. The gap depends on the photos. On the sharp digital Unsplash sample AVIF was 40% smaller; on the Kodak film scans it was 21% smaller. Test a sample of your own images before you switch.

Same file size, different quality

Now the other way round: every format gets the same byte budget, and you see what it buys. Flip between the formats; the crops are zoomed 2× with no smoothing, so every artifact stays visible.

Photo

14.4 KB budget · 0.30 bits per pixel

Photo: the lossless sourcePhoto: decoded from a 14.2 KB JPEG file, SSIMULACRA2 43.8Photo: decoded from a 14.3 KB WebP file, SSIMULACRA2 53.6Photo: decoded from a 13.2 KB AVIF file, SSIMULACRA2 63.4Photo: decoded from a 14.3 KB JPEG XL file, SSIMULACRA2 62.3
Show the photo as
Kodak image 23, 200 × 200 crop at 2×. Every encoded file is within 1.2 KB of the budget.

Screenshot text

31.3 KB budget · 0.25 bits per pixel

Screenshot text: the lossless sourceScreenshot text: decoded from a 30.4 KB JPEG file, SSIMULACRA2 40.7Screenshot text: decoded from a 31.2 KB WebP file, SSIMULACRA2 55.3Screenshot text: decoded from a 30.8 KB AVIF file, SSIMULACRA2 64.9Screenshot text: decoded from a 30.4 KB JPEG XL file, SSIMULACRA2 28.8
Show the screenshot text as
ImageGuide page, 240 × 148 crop at 2×. Every encoded file is within 0.9 KB of the budget.

Every photo, not just the median

Each dot is one photo's file size against mozjpeg at score 70; the bar is the median. A dot right of the line needed more bytes than JPEG.

WebP: median -7% across 71 photos. AVIF: median -31% across 71 photos. JPEG XL: median -23% across 71 photos -80% -60% -40% -20% JPEG size +20% WebP kodim01: -3% kodim02: +2% kodim03: -17% kodim04: +9% kodim05: -7% kodim06: +7% kodim07: -18% kodim08: -6% kodim09: -16% kodim10: -14% kodim11: -3% kodim12: +1% kodim13: +5% kodim14: -4% kodim15: -10% kodim16: +5% kodim17: -8% kodim18: -1% kodim19: +1% kodim20: -8% kodim21: -2% kodim22: +5% kodim23: -9% kodim24: -2% u01-wud-eV6Vpwo: +13% u02-AM78wX6VQ7A: +4% u03-6Omj65__XW8: +4% u04-ttjZ2LAbwDs: +7% u05-kXYmB2m-poo: +4% u06-7od8rzWvUVU: +1% u07-yYyoSmJeCTM: -36% u08-NIz7SKse_wQ: -8% u10-sLOxRwj5uT0: -13% u12-jPPHYSez-s4: -3% u13-wKcbeA6dPkY: -41% u14-5aSSM6wbdJc: -16% u15-alzTQTQraEs: -47% u16-zNwFleFYTB0: +7% u17-Mbm0WnJ5emc: -30% u18-XbGbigKAez4: -27% u19-YLrvkbT0zOA: +3% u21-PtXbcYeQ7so: -32% u22-esOC8MkpLPA: -16% u23-JWotIvwwZ30: -38% u24-WBqYBqvqAe4: -75% u25-Dn-NBprVOUU: -7% u26-mcjpMVnI1y4: -12% u27-PteQb2-8rmY: -7% u28-nUATzmSnJXg: +6% u29-9AnJdlHv0Yg: -25% u30-zP-splBKjRU: -23% u31-MXoJq2OIvUA: -30% u32-y0M28vXTiBY: +13% u33-iuqmGmst5Po: -33% u34-EhSNha7EV9Y: -27% u35-UmFxT8lQBJw: +14% u36-YjVhNv01UjM: -15% u37-E3XUdw2ohd4: -16% u38-Vt2k4g2eUws: -27% u39-zbIlxgjOKb4: +2% u40-WKVGmz7o0O4: +17% u41-key_K9_qLrU: -5% u42-jWFUsU24Boo: +6% u43-RRM4SoLsXjA: +18% u44-x6sryLt6VZ0: 0% u45-zT1w8eGX50c: -8% u46-B0r1ra71Bfo: -6% u47-NJY3uia5dqE: -24% u48-aViOE3m_BgU: -34% u49-23AS61ws1qw: -9% u50-pdALzg0yN-8: -12% -7% AVIF kodim01: -16% kodim02: -14% kodim03: -35% kodim04: -20% kodim05: -24% kodim06: -15% kodim07: -37% kodim08: -28% kodim09: -34% kodim10: -35% kodim11: -18% kodim12: -20% kodim13: -12% kodim14: -16% kodim15: -33% kodim16: -16% kodim17: -26% kodim18: -15% kodim19: -23% kodim20: -30% kodim21: -22% kodim22: -14% kodim23: -36% kodim24: -21% u01-wud-eV6Vpwo: -29% u02-AM78wX6VQ7A: -12% u03-6Omj65__XW8: -8% u04-ttjZ2LAbwDs: -9% u05-kXYmB2m-poo: -23% u06-7od8rzWvUVU: -27% u07-yYyoSmJeCTM: -57% u08-NIz7SKse_wQ: -35% u10-sLOxRwj5uT0: -40% u11-WquLr1q8pUw: -81% u12-jPPHYSez-s4: -24% u13-wKcbeA6dPkY: -53% u14-5aSSM6wbdJc: -38% u15-alzTQTQraEs: -60% u16-zNwFleFYTB0: -17% u17-Mbm0WnJ5emc: -44% u18-XbGbigKAez4: -46% u19-YLrvkbT0zOA: -12% u21-PtXbcYeQ7so: -51% u22-esOC8MkpLPA: -40% u23-JWotIvwwZ30: -65% u24-WBqYBqvqAe4: -88% u25-Dn-NBprVOUU: -41% u26-mcjpMVnI1y4: -40% u27-PteQb2-8rmY: -60% u28-nUATzmSnJXg: -21% u30-zP-splBKjRU: -48% u31-MXoJq2OIvUA: -55% u32-y0M28vXTiBY: -31% u33-iuqmGmst5Po: -46% u34-EhSNha7EV9Y: -43% u35-UmFxT8lQBJw: -2% u36-YjVhNv01UjM: -42% u37-E3XUdw2ohd4: -40% u38-Vt2k4g2eUws: -54% u39-zbIlxgjOKb4: -21% u40-WKVGmz7o0O4: -14% u41-key_K9_qLrU: -39% u42-jWFUsU24Boo: -19% u43-RRM4SoLsXjA: -33% u44-x6sryLt6VZ0: -23% u45-zT1w8eGX50c: -46% u46-B0r1ra71Bfo: -21% u47-NJY3uia5dqE: -48% u48-aViOE3m_BgU: -60% u49-23AS61ws1qw: -23% u50-pdALzg0yN-8: -41% -31% JPEG XL kodim01: -5% kodim02: -18% kodim03: -17% kodim04: -17% kodim05: -8% kodim06: -10% kodim07: -19% kodim08: -12% kodim09: -22% kodim10: -21% kodim11: -11% kodim12: -13% kodim13: -2% kodim14: -9% kodim15: -29% kodim16: -13% kodim17: -15% kodim18: -13% kodim19: -12% kodim20: -12% kodim21: -17% kodim22: -7% kodim23: -32% kodim24: -13% u01-wud-eV6Vpwo: -33% u02-AM78wX6VQ7A: -9% u03-6Omj65__XW8: -3% u04-ttjZ2LAbwDs: -17% u05-kXYmB2m-poo: -21% u06-7od8rzWvUVU: -24% u07-yYyoSmJeCTM: -41% u08-NIz7SKse_wQ: -23% u10-sLOxRwj5uT0: -50% u11-WquLr1q8pUw: -72% u12-jPPHYSez-s4: -25% u13-wKcbeA6dPkY: -53% u14-5aSSM6wbdJc: -22% u15-alzTQTQraEs: -30% u16-zNwFleFYTB0: -12% u17-Mbm0WnJ5emc: -35% u18-XbGbigKAez4: -45% u19-YLrvkbT0zOA: -1% u21-PtXbcYeQ7so: -42% u22-esOC8MkpLPA: -25% u23-JWotIvwwZ30: -62% u24-WBqYBqvqAe4: -56% u25-Dn-NBprVOUU: -26% u26-mcjpMVnI1y4: -37% u27-PteQb2-8rmY: -43% u28-nUATzmSnJXg: -32% u30-zP-splBKjRU: -41% u31-MXoJq2OIvUA: -49% u32-y0M28vXTiBY: -26% u33-iuqmGmst5Po: -41% u34-EhSNha7EV9Y: -39% u35-UmFxT8lQBJw: +8% u36-YjVhNv01UjM: -43% u37-E3XUdw2ohd4: -43% u38-Vt2k4g2eUws: -45% u39-zbIlxgjOKb4: -22% u40-WKVGmz7o0O4: -9% u41-key_K9_qLrU: -29% u42-jWFUsU24Boo: -17% u43-RRM4SoLsXjA: -33% u44-x6sryLt6VZ0: -28% u45-zT1w8eGX50c: -41% u46-B0r1ra71Bfo: -13% u47-NJY3uia5dqE: -36% u48-aViOE3m_BgU: -43% u49-23AS61ws1qw: -20% u50-pdALzg0yN-8: -37% -23%

Quality against size

Median bits per pixel each format needs for each score. Further left is smaller; the size axis is logarithmic.

All photos · 74 images
50 60 70 80 90 0.250.512 bits per pixel JPEG WebP AVIF JPEG XL
Screenshots · 12 images
50 60 70 80 90 0.10.250.51 bits per pixel JPEG WebP AVIF JPEG XL

Every median

Median bits per pixel to reach each score, then the median per-image size change against mozjpeg (negative is smaller). A count shows when some images never reached the score.

All photos 74 images
Encoder 50 medium60 medium to high70 high80 very high90 visually lossless
JPEG sharp mozjpeg, 4:2:0 0.39 73/74 0.51 0.72 72/74 1.17 69/74 n/a 26/74
WebP cwebp -m 6 0.34 -9% 72/74 0.47 -6% 73/74 0.70 -7% 73/74 1.15 -5% 73/74 n/a 9/74
AVIF avifenc (libaom) -s 6 0.25 -34% 70/74 0.33 -34% 73/74 0.47 -31% 73/74 0.88 -25% 2.74 71/74
JPEG XL cjxl -e 7 0.34 -23% 64/74 0.41 -23% 71/74 0.57 -23% 72/74 0.88 -25% 70/74 2.22 68/74
Modern photos (Unsplash) 50 images
Encoder 50 medium60 medium to high70 high80 very high90 visually lossless
JPEG sharp mozjpeg, 4:2:0 0.27 49/50 0.34 0.49 48/50 0.80 45/50 n/a 11/50
WebP cwebp -m 6 0.25 -18% 48/50 0.33 -16% 49/50 0.52 -9% 49/50 0.89 -2% 49/50 n/a 3/50
AVIF avifenc (libaom) -s 6 0.18 -39% 46/50 0.24 -42% 49/50 0.35 -40% 49/50 0.63 -32% 2.32 47/50
JPEG XL cjxl -e 7 0.27 -27% 40/50 0.28 -30% 47/50 0.33 -33% 48/50 0.53 -35% 46/50 1.92 44/50
Kodak suite 24 images
Encoder 50 medium60 medium to high70 high80 very high90 visually lossless
JPEG sharp mozjpeg, 4:2:0 0.50 0.65 0.93 1.55 3.79 15/24
WebP cwebp -m 6 0.51 -1% 0.66 -2% 0.96 -3% 1.54 -7% n/a 6/24
AVIF avifenc (libaom) -s 6 0.38 -30% 0.52 -26% 0.74 -21% 1.26 -21% 2.91 -24%
JPEG XL cjxl -e 7 0.40 -15% 0.54 -13% 0.77 -13% 1.24 -18% 2.68 -29%
Screenshots 12 images
Encoder 50 medium60 medium to high70 high80 very high90 visually lossless
JPEG sharp mozjpeg, 4:2:0 0.20 0.26 0.36 0.63 n/a 0/12
WebP cwebp -m 6 0.17 -29% 6/12 0.16 -33% 0.23 -37% 0.36 -42% 11/12 n/a 0/12
AVIF avifenc (libaom) -s 6 0.11 -49% 9/12 0.12 -51% 0.17 -50% 0.29 -58% 1.06 6/12
JPEG XL cjxl -e 7 0.18 -8% 0.20 -21% 0.25 -30% 0.37 -41% 1.01

Press defaults against the reference encoders

Press converts whole folders on your computer with its default settings. This is the size it needs for the same score as the reference encoder of the same format, on photos at score 70.

FormatReferencePress 0.9.1Press vs reference
JPEG 0.72 bpp 0.72 bpp 0%
WebP 0.70 bpp 0.75 bpp +8%
AVIF 0.47 bpp 0.47 bpp -1%
JPEG XL 0.57 bpp 0.56 bpp -1%

The 86 images

Every result above comes from these files. The corpus manifest lists the URL, dimensions and SHA-256 hash of each one, and the script checks every hash before it measures anything.

Unsplash Lite sample 50

Every 500th row of the 25,000-row Unsplash Lite dataset (rows 0 to 24,500), fetched as lossless PNG with the longest edge at 1600 px. Unsplash License (https://unsplash.com/license). Source

  • u01-wud-eV6Vpwo, photo by @sergio_rola
  • u02-AM78wX6VQ7A, photo by @ethandow
  • u03-6Omj65__XW8, photo by @caleb_white
  • u04-ttjZ2LAbwDs, photo by @alice02
  • u05-kXYmB2m-poo, photo by @introspectivedsgn
  • u06-7od8rzWvUVU, photo by @ismailhamzahk
  • u07-yYyoSmJeCTM, photo by @3tnik
  • u08-NIz7SKse_wQ, photo by @gk3
  • u09-qwoW4mdqjWw, photo by @ponolopez
  • u10-sLOxRwj5uT0, photo by @nate_dumlao
  • u11-WquLr1q8pUw, photo by @lucabravo
  • u12-jPPHYSez-s4, photo by @jeremybishop
  • u13-wKcbeA6dPkY, photo by @shawnolivier
  • u14-5aSSM6wbdJc, photo by @quicksand
  • u15-alzTQTQraEs, photo by @thejmoore
  • u16-zNwFleFYTB0, photo by @vargafilip123
  • u17-Mbm0WnJ5emc, photo by @conti_photos
  • u18-XbGbigKAez4, photo by @grievek1610begur
  • u19-YLrvkbT0zOA, photo by @noctous_
  • u20-A9B_cgBGa_4, photo by @nestormorales
  • u21-PtXbcYeQ7so, photo by @philipp_k
  • u22-esOC8MkpLPA, photo by @jacksonjost
  • u23-JWotIvwwZ30, photo by @stevenwright
  • u24-WBqYBqvqAe4, photo by @zenz
  • u25-Dn-NBprVOUU, photo by @jeancarloemer
  • u26-mcjpMVnI1y4, photo by @worldsbetweenlines
  • u27-PteQb2-8rmY, photo by @davidclode
  • u28-nUATzmSnJXg, photo by @kunjparekh
  • u29-9AnJdlHv0Yg, photo by @akin
  • u30-zP-splBKjRU, photo by @carnaby
  • u31-MXoJq2OIvUA, photo by @aaronburden
  • u32-y0M28vXTiBY, photo by @doxor
  • u33-iuqmGmst5Po, photo by @tobiasmrzyk
  • u34-EhSNha7EV9Y, photo by @meghanschiereck
  • u35-UmFxT8lQBJw, photo by @luddyphoto
  • u36-YjVhNv01UjM, photo by @octoberroses
  • u37-E3XUdw2ohd4, photo by @kris_ricepees
  • u38-Vt2k4g2eUws, photo by @lucasmendesph
  • u39-zbIlxgjOKb4, photo by @ryanpernofski
  • u40-WKVGmz7o0O4, photo by @jeremy
  • u41-key_K9_qLrU, photo by @tengyart
  • u42-jWFUsU24Boo, photo by @taynicole0630
  • u43-RRM4SoLsXjA, photo by @joegeek
  • u44-x6sryLt6VZ0, photo by @tata186
  • u45-zT1w8eGX50c, photo by @timberfoster
  • u46-B0r1ra71Bfo, photo by @simonlundh
  • u47-NJY3uia5dqE, photo by @phthalles
  • u48-aViOE3m_BgU, photo by @catch_a_vibe_photo
  • u49-23AS61ws1qw, photo by @mischievous_penguins
  • u50-pdALzg0yN-8, photo by @modcatshop

Kodak test suite 24

Released by Eastman Kodak for unrestricted use. Source

  • Kodak test suite: kodim01
  • Kodak test suite: kodim02
  • Kodak test suite: kodim03
  • Kodak test suite: kodim04
  • Kodak test suite: kodim05
  • Kodak test suite: kodim06
  • Kodak test suite: kodim07
  • Kodak test suite: kodim08
  • Kodak test suite: kodim09
  • Kodak test suite: kodim10
  • Kodak test suite: kodim11
  • Kodak test suite: kodim12
  • Kodak test suite: kodim13
  • Kodak test suite: kodim14
  • Kodak test suite: kodim15
  • Kodak test suite: kodim16
  • Kodak test suite: kodim17
  • Kodak test suite: kodim18
  • Kodak test suite: kodim19
  • Kodak test suite: kodim20
  • Kodak test suite: kodim21
  • Kodak test suite: kodim22
  • Kodak test suite: kodim23
  • Kodak test suite: kodim24

Web page screenshots 12

Published by Sirv for benchmark use.

  • Web page screenshots: screen01
  • Web page screenshots: screen02
  • Web page screenshots: screen03
  • Web page screenshots: screen04
  • Web page screenshots: screen05
  • Web page screenshots: screen06
  • Web page screenshots: screen07
  • Web page screenshots: screen08
  • Web page screenshots: screen09
  • Web page screenshots: screen10
  • Web page screenshots: screen11
  • Web page screenshots: screen12

Method

  • Each image is encoded at quality 10, 20, 30, 40, 50, 60, 65, 70, 75, 80, 85, 90, 95, 98 by every encoder.
  • Every output is decoded to PNG and scored against the lossless source with SSIMULACRA2 (ssimulacra2_rs 0.5.2). 70 is high quality, 90 is visually lossless.
  • For each image, the size needed for scores 50, 60, 70, 80, 90 is interpolated between the two settings that bracket the score. Images that never reach a score are left out of that median and counted.
  • Savings are the median of per-image savings against mozjpeg, so one huge file cannot move the result.
  • Encoders run at their default effort except where listed. Encode speed is not measured.

Encoders and versions

JPEG
sharp mozjpeg, 4:2:0
WebP
cwebp -m 6
AVIF
avifenc (libaom) -s 6
JPEG XL
cjxl -e 7
Runtime
sharp 0.35.5 (mozjpeg 0826579) · libwebp 1.6.0 · avifenc 1.4.2 (dav1d [dec]:1.5.4, aom [enc/dec]:v3.15.0, rav1e [enc]:0.8.1 (UNKNOWN), svt [enc]:v4.2.0) · cjxl v0.12.0 · Press 0.9.1

Run the same benchmark

Install Node.js 22, cwebp/dwebp, avifenc/avifdec, cjxl/djxl, ImageMagick, ssimulacra2_rs and Press. Then download the script and the manifest and run it. A full run takes about half an hour on 16 cores.

curl -O https://www.imageguide.dev/benchmarks/v2/run.mjs
curl -O https://www.imageguide.dev/benchmarks/v2/corpus.json
cargo install --no-default-features ssimulacra2_rs
npm install sharp
node run.mjs --work ./work --out results.json

Use --limit 2 to check your setup on two images per group first.