You are viewing this site in a simplified layout because your browser does not yet support CSS Subgrid.

op111.net

Search op111.net

PNG and modern image formats: A comparison of lossless image compression

In my comparison of PNG compressors I was also curious to see what WebP, a modern image format, could do with the same set of images. So, I converted all images losslessly to WebP and included the WebP numbers too in the tables.

This test expands the comparison to add another three modern image formats: AVIF, HEIF, and JPEG XL. The image set is the same that I used in the comparison of the PNG tools.

The results are presented in the tables below.

The results are also available in a Google Sheets document: op111.net, 2025-10-15, PNG and modern image formats

And in the file with the hyperfine measurements: op111-20251015-png-modern-formats-hyperfine-data.txt

For the hardware, operating systems, and tool versions used, see section at the bottom.

IMPORTANT NOTE

This test compares PNG with four modern image formats at what PNG is best for (lossless compression of graphics images, not compression of photographs) rather than what the modern formats are best for.

The four modern image formats—AVIF, HEIF, JPEG XL, and WebP—were not designed with the same goals as PNG, or with the same goals with each other, and, while all have a lossless mode, lossless compression was not a primary design goal in all of them.

For any questions, corrections, or if you just want to say hi, please use the contact form.

d3js.org.png

Thumbnail of the d3js.org.png image used in the test

Screenshot of the D3.js homepage I took in Firefox, Debian 13 (GNOME 48, Wayland), using the FireShot extension.

  • Filename: d3js.org.png
  • Original size: 1,493,211 bytes
  • Dimensions: 1600 × 1205 pixels
  • Number of colors: 168,716
  • Original image: d3js.org.png

COMPRESSION RESULTS FOR d3js.org.png

Program and settingsTimeSizeReduction
oxipng default0.764s1,058,04629.14%
oxipng --opt max1.937s1,046,44629.92%
oxipng --opt max --zopfli --fast20.504s1,041,55230.25%
oxipng --opt max --zopfli28.986s1,041,55230.25%
avifenc -l0.415s1,394,5516.61%
avifenc -l --speed 08.062s1,087,37127.18%
heif-enc -l0.408s1,322,75711.42%
heif-enc -l -p preset=veryslow0.408s1,322,61611.42%
cjxl -q 1001.506s697,97853.26%
cjxl -q 100 --effort 95.967s676,89154.67%
cwebp -lossless -mt -exact0.532s828,99244.48%
cwebp -lossless -mt -z 9 -exact3.845s813,60645.51%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 24.42 percentage points better than PNG.
  • WebP is 15.26 percentage points better than PNG.

debian-desktop.png

Thumbnail of the debian-desktop.png image used in the test

Screenshot of my Debian desktop I took with the GNOME screenshot tool (Debian 13, GNOME 48, Wayland).

  • Filename: debian-desktop.png
  • Original size: 707,471 bytes
  • Dimensions: 2560 × 1440 pixels
  • Number of colors: 20,322
  • Original image: debian-desktop.png

COMPRESSION RESULTS FOR debian-desktop.png

Program and settingsTimeSizeReduction
oxipng default1.488s448,54436.60%
oxipng --opt max7.005s392,71044.49%
oxipng --opt max --zopfli --fast64.088s431,81538.96%
oxipng --opt max --zopfli156.336s382,45945.94%
avifenc -l0.894s496,64129.80%
avifenc -l --speed 014.760s413,59341.54%
heif-enc -l0.484s394,58444.23%
heif-enc -l -p preset=veryslow0.489s394,63644.22%
cjxl -q 1000.345s270,40361.78%
cjxl -q 100 --effort 91.190s215,98669.47%
cwebp -lossless -mt -exact0.864s328,60253.55%
cwebp -lossless -mt -z 9 -exact2.373s264,57062.60%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 23.53 percentage points better than PNG.
  • WebP is 16.66 percentage points better than PNG.

drought-map.png

Thumbnail of the drought-map.png image used in the test

Map showing drought conditions in Europe from the European Environment Agency.

COMPRESSION RESULTS FOR drought-map.png

Program and settingsTimeSizeReduction
oxipng default1.623s601,96538.38%
oxipng --opt max5.247s589,60239.65%
oxipng --opt max --zopfli --fast85.481s580,99340.53%
oxipng --opt max --zopfli109.564s580,99340.53%
avifenc -l4.966s1,213,395-24.21%
avifenc -l --speed 095.062s1,043,139-6.78%
heif-enc -l0.529s1,874,253-91.85%
heif-enc -l -p preset=veryslow0.537s1,871,735-91.60%
cjxl -q 1000.327s535,57945.18%
cjxl -q 100 --effort 90.841s495,82049.25%
cwebp -lossless -mt -exact0.304s374,35661.68%
cwebp -lossless -mt -z 9 -exact3.401s369,06462.22%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 8.72 percentage points better than PNG (second smallest difference in the set).
  • WebP is 21.69 percentage points better than PNG.

github.com-repo.png

Thumbnail of the github.com-repo.png image used in the test

Screenshot of the oxipng repo on GitHub I took in Chrome on Debian using the FireShot extension.

  • Filename: github.com-repo.png
  • Original size: 269,531 bytes
  • Dimensions: 1352 × 1105 pixels
  • Number of colors: 5,720
  • Original image: github.com-repo.png

COMPRESSION RESULTS FOR github.com-repo.png

Program and settingsTimeSizeReduction
oxipng default0.310s169,02237.29%
oxipng --opt max0.913s167,59037.82%
oxipng --opt max --zopfli --fast21.438s162,97039.54%
oxipng --opt max --zopfli25.154s162,97039.54%
avifenc -l1.887s254,9365.41%
avifenc -l --speed 026.852s204,50724.12%
heif-enc -l0.199s422,032-56.58%
heif-enc -l -p preset=veryslow0.199s421,144-55.25%
cjxl -q 1000.604s112,14258.39%
cjxl -q 100 --effort 91.981s106,98660.31%
cwebp -lossless -mt -exact0.070s76,35871.67%
cwebp -lossless -mt -z 9 -exact1.069s70,08474.00%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 20.77 percentage points better than PNG.
  • WebP is 34.46 percentage points better than PNG (second biggest difference in the set).

goaccess.io-demo.png

Thumbnail of the goaccess.io-demo.png image used in the test

Screenshot of the GoAccess demo page I took in Firefox on Debian using the FireShot extension.

  • Filename: goaccess.io-demo.png
  • Original size: 325,494 bytes
  • Dimensions: 1600 × 1205 pixels
  • Number of colors: 3,032
  • Original image: goaccess.io-demo.png

COMPRESSION RESULTS FOR goaccess.io-demo.png

Program and settingsTimeSizeReduction
oxipng default0.605s201,05538.23%
oxipng --opt max1.421s193,23540.63%
oxipng --opt max --zopfli --fast32.375s189,05941.92%
oxipng --opt max --zopfli41.427s189,05941.92%
avifenc -l2.085s395,808-21.60%
avifenc -l --speed 032.237s296,8958.79%
heif-enc -l0.326s690,102-112.02%
heif-enc -l -p preset=veryslow0.329s688,626-111.56%
cjxl -q 1000.849s123,51562.05%
cjxl -q 100 --effort 92.878s115,62664.48%
cwebp -lossless -mt -exact0.091s89,14272.61%
cwebp -lossless -mt -z 9 -exact1.818s88,02272.96%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 22.56 percentage points better than PNG.
  • WebP is 31.04 percentage points better than PNG.

html5-logo.png

Thumbnail of the html5-logo.png image used in the test

The official HTML5 logo from W3C.

  • Filename: html5-logo.png
  • Original size: 8,562 bytes
  • Dimensions: 512 × 512 pixels
  • Number of colors: 84
  • Source: https://www.w3.org/html/logo/
  • Original filename: HTML5_Logo_512.png

COMPRESSION RESULTS FOR html5-logo.png

Program and settingsTimeSizeReduction
oxipng default0.052s5,14739.89%
oxipng --opt max0.191s4,42948.27%
oxipng --opt max --zopfli --fast2.046s4,27350.09%
oxipng --opt max --zopfli3.528s4,13151.75%
avifenc -l0.291s11,736-37.07%
avifenc -l --speed 03.583s10,765-25.73%
heif-enc -l0.111s20,586-140.43%
heif-enc -l -p preset=veryslow0.110s20,630-140.95%
cjxl -q 1000.095s2,61469.47%
cjxl -q 100 --effort 90.205s2,23373.92%
cwebp -lossless -mt -exact0.015s3,41660.10%
cwebp -lossless -mt -z 9 -exact0.497s3,46059.59%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 22.72 percentage points better than PNG.
  • WebP is 8.35 percentage points better than PNG (second smallest difference in the set).

mediawiki-logo.png

Thumbnail of the mediawiki-logo.png image used in the test

The MediaWiki logo.

COMPRESSION RESULTS FOR mediawiki-logo.png

Program and settingsTimeSizeReduction
oxipng default0.046s24,63214.04%
oxipng --opt max0.171s24,66413.93%
oxipng --opt max --zopfli --fast1.363s24,21115.51%
oxipng --opt max --zopfli2.816s24,21115.51%
avifenc -l0.048s39,557-38.04%
avifenc -l --speed 01.190s33,335-16.33%
heif-enc -l0.092s29,217-1.96%
heif-enc -l -p preset=veryslow0.094s29,195-1.88%
cjxl -q 1000.091s19,98630.26%
cjxl -q 100 --effort 90.346s16,11843.75%
cwebp -lossless -mt -exact0.058s19,83030.80%
cwebp -lossless -mt -z 9 -exact0.367s17,91837.47%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 28.24 percentage points better than PNG (second biggest difference in the set).
  • WebP is 21.96 percentage points better than PNG.

powertoys.png

Thumbnail of the powertoys.png image used in the test

Screenshot of the Microsoft PowerToys settings window I took on Windows 11 and saved with Paint.NET v5.1.9.

  • Filename: powertoys.png
  • Original size: 244,630 bytes
  • Dimensions: 1230 × 917 pixels
  • Number of colors: 18,791
  • Original image: powertoys.png

COMPRESSION RESULTS FOR powertoys.png

Program and settingsTimeSizeReduction
oxipng default0.266s201,53317.62%
oxipng --opt max0.725s198,00819.06%
oxipng --opt max --zopfli --fast8.663s194,70920.41%
oxipng --opt max --zopfli13.882s194,70920.41%
avifenc -l1.572s271,010-10.78%
avifenc -l --speed 018.772s252,120-3.06%
heif-enc -l0.200s343,268-40.32%
heif-enc -l -p preset=veryslow0.204s342,830-40.14%
cjxl -q 1000.592s141,99441.96%
cjxl -q 100 --effort 92.521s138,67243.31%
cwebp -lossless -mt -exact0.178s144,24641.04%
cwebp -lossless -mt -z 9 -exact0.975s140,09042.73%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 22.90 percentage points better than PNG.
  • WebP is 22.32 percentage points better than PNG.

pschmidt.png

Thumbnail of the pschmidt.png image used in the test

Test image created by Paul Schmidt, member of the PNG Development Group. It has 16,777,216 unique colors, which is the maximum number of colors for the most common “full color” PNG format (three 8-bit channels for red, green, and blue).

COMPRESSION RESULTS FOR pschmidt.png

Program and settingsTimeSizeReduction
oxipng default1.411s59,8400.02%
oxipng --opt max2.770s57,7573.50%
oxipng --opt max --zopfli --fast309.241s55,9896.45%
oxipng --opt max --zopfli408.220s55,9896.45%
avifenc -l1.134s1,569,098-2521.63%
avifenc -l --speed 03.802s7,75487.04%
heif-enc -l1.816s4,625,714-7628.59%
heif-enc -l -p preset=veryslow1.811s4,629,216-7634.44%
cjxl -q 1001.627s34,73441.97%
cjxl -q 100 --effort 94.533s21,54064.01%
cwebp -lossless -mt -exact1.574s7,42087.60%
cwebp -lossless -mt -z 9 -exact4.129s5,51690.78%

NOTES

  • WebP wins.
  • AVIF is second.
  • JPEG XL is 57.56 percentage points better than PNG (biggest difference in the set).
  • WebP is 84.33 percentage points better than PNG (biggest difference in the set).

radar-chart.png

Thumbnail of the radar-chart.png image used in the test

Sample radar chart from the Chart.js documentation.

COMPRESSION RESULTS FOR radar-chart.png

Program and settingsTimeSizeReduction
oxipng default0.283s73,40239.68%
oxipng --opt max1.008s71,48441.25%
oxipng --opt max --zopfli --fast11.468s68,92743.36%
oxipng --opt max --zopfli19.364s68,92743.36%
avifenc -l0.181s138,217-13.59%
avifenc -l --speed 03.257s121,920-0.19%
heif-enc -l0.168s110,5119.18%
heif-enc -l -p preset=veryslow0.171s110,6289.09%
cjxl -q 1000.305s67,56044.48%
cjxl -q 100 --effort 91.225s60,94049.92%
cwebp -lossless -mt -exact0.181s58,39452.01%
cwebp -lossless -mt -z 9 -exact0.906s44,40863.51%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 6.56 percentage points better than PNG (smallest difference in the set).
  • WebP is 20.15 percentage points better than PNG.

spacefun.png

Thumbnail of the spacefun.png image used in the test

The default wallpaper of Debian 6 (Squeeze). I exported it from SVG to PNG with Inkscape v1.4.0.

  • Filename: spacefun.png
  • Original size: 5,305,726 bytes
  • Dimensions: 3840 × 2160 pixels
  • Number of colors: 24,501
  • Source: packages.debian.org/trixie/desktop-base
  • Original filename: /usr/share/desktop-base/spacefun-theme/wallpaper/contents/images/3840x2160.svg

COMPRESSION RESULTS FOR spacefun.png

Program and settingsTimeSizeReduction
oxipng default7.958s3,267,87338.41%
oxipng --opt max11.882s3,270,85838.35%
oxipng --opt max --zopfli --fast430.480s3,240,29138.93%
oxipng --opt max --zopfli626.792s3,240,29138.93%
avifenc -l1.698s4,001,86024.57%
avifenc -l --speed 035.821s3,843,08227.57%
heif-enc -l1.445s3,657,34131.07%
heif-enc -l -p preset=veryslow1.483s3,655,62531.10%
cjxl -q 1000.743s2,764,75847.89%
cjxl -q 100 --effort 92.345s2,633,59550.36%
cwebp -lossless -mt -exact2.779s3,534,12233.39%
cwebp -lossless -mt -z 9 -exact11.273s3,099,53241.58%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 11.43 percentage points better than PNG.
  • WebP is 2.65 percentage points better than PNG (smallest difference in the set).

stripe.com.png

Thumbnail of the stripe.com.png image used in the test

Screenshot of the Stripe homepage I took in Firefox on Windows 11 using the FireShot extension.

  • Filename: stripe.com.png
  • Original size: 401,189 bytes
  • Dimensions: 1678 × 1274 pixels
  • Number of colors: 63,894
  • Original image: stripe.com.png

COMPRESSION RESULTS FOR stripe.com.png

Program and settingsTimeSizeReduction
oxipng default0.878s337,23315.94%
oxipng --opt max1.897s329,50517.87%
oxipng --opt max --zopfli --fast37.605s324,33919.16%
oxipng --opt max --zopfli73.949s324,33919.16%
avifenc -l2.235s452,910-12.89%
avifenc -l --speed 032.892s411,104-2.47%
heif-enc -l0.288s464,819-15.86%
heif-enc -l -p preset=veryslow0.291s465,024-15.91%
cjxl -q 1000.911s261,44434.83%
cjxl -q 100 --effort 94.385s214,65646.50%
cwebp -lossless -mt -exact0.461s272,11632.17%
cwebp -lossless -mt -z 9 -exact2.967s263,61834.29%

NOTES

  • JPEG XL wins.
  • WebP is second.
  • JPEG XL is 27.34 percentage points better than PNG.
  • WebP is 15.13 percentage points better than PNG.

vitejs-logo.png

Thumbnail of the vitejs-logo.png image used in the test

The logo of Vite, the frontend build tool.

COMPRESSION RESULTS FOR vitejs-logo.png

Program and settingsTimeSizeReduction
oxipng default0.088s22,43312.59%
oxipng --opt max0.398s22,06414.02%
oxipng --opt max --zopfli --fast3.966s21,46716.35%
oxipng --opt max --zopfli10.502s21,46716.35%
avifenc -l0.363s38,120-48.54%
avifenc -l --speed 04.409s36,804-43.41%
heif-enc -l0.126s39,168-52.62%
heif-enc -l -p preset=veryslow0.126s39,176-52.66%
cjxl -q 1000.143s24,6883.80%
cjxl -q 100 --effort 90.644s18,08829.52%
cwebp -lossless -mt -exact0.076s19,32424.70%
cwebp -lossless -mt -z 9 -exact0.554s16,86834.27%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 13.17 percentage points better than PNG.
  • WebP is 17.92 percentage points better than PNG.

wsl-logo.png

Thumbnail of the wsl-logo.png image used in the test

The logo of the Windows Subsystem for Linux (WSL).

COMPRESSION RESULTS FOR wsl-logo.png

Program and settingsTimeSizeReduction
oxipng default0.072s17,9065.95%
oxipng --opt max0.155s17,01810.61%
oxipng --opt max --zopfli --fast2.280s16,65512.52%
oxipng --opt max --zopfli3.108s16,65512.52%
avifenc -l0.169s23,632-24.13%
avifenc -l --speed 01.576s22,275-17.00%
heif-enc -l0.094s24,683-29.65%
heif-enc -l -p preset=veryslow0.095s24,507-28.73%
cjxl -q 1000.073s15,95916.17%
cjxl -q 100 --effort 90.322s14,01126.41%
cwebp -lossless -mt -exact0.049s12,98031.82%
cwebp -lossless -mt -z 9 -exact0.325s12,54434.11%

NOTES

  • WebP wins.
  • JPEG XL is second.
  • JPEG XL is 13.89 percentage points better than PNG.
  • WebP is 21.59 percentage points better than PNG.

General notes

One note:

Unless there is something wrong in the way I ran the tests, HEIF seems to be the inverse of PNG. It was designed for photographs and it struggles with what PNG is best at, lossless compression of graphics images.

Hardware, operating systems, and tools used in the tests

HARDWARE

  • AMD Ryzen 7 5700G (8 cores, 16 threads, up to 4.67 GHz)
  • 64 GB RAM (2×32 GB DDR4-3600, dual-channel)
  • Samsung 970 EVO Plus NVMe SSD (ext4 partition on Linux, NTFS partition on Windows)

OPERATING SYSTEMS

  • Debian 13 (Trixie), kernel 6.12.38
  • Windows 11 PRO 26100.4946 (24H2)

COMPRESSION TOOLS

  • avifenc 1.2.1 (version in Debian 13)
  • cjxl 0.11.1 (version in Debian 13)
  • cwebp 1.5.0 (version in Debian 13)
  • heif-enc 1.19.8 (version in Debian 13)
  • oxipng 9.1.5 (version in Debian 13)

— Demetris, 2025-10-15