Skip to content

Bits per pixel of Internet images

Yannis Guyon edited this page Sep 2, 2024 · 1 revision

The 2022 Web Almanac has a "Bits per pixel" section:
https://almanac.httparchive.org/en/2022/media#bits-per-pixel

It shows aggregated statistics about the compression ratio. But the distribution is across all formats, and only the median is shown for each format.

Here is an excerpt regarding AVIF:
"The format dropped from 1.5 bits per pixel last year—less compressed than WebP already!—all the way down to 1.0. [...]
AVIF’s browser support also took a huge leap this year. All of this is to say, if you’re sending bitmap images across the web—as you may recall, 99.9% of pages do—you should at least consider sending AVIFs."

It is hard to draw conclusions with this level of abstraction.
This page is an exploration to obtain more fine-grained results from the same data source, the HTTPArchive:
https://httparchive.org/

Megapixels buckets

Sorting images by dimensions is a first step.
A megapixel is defined as 1,000,000 pixels here.

From 1 to 2 megapixels

bits-per-pixel 10th percentile 50th percentile 90th percentile
JPEG desktop (mobile) 0.49 (0.48) 1.30 (1.26) 3.94 (3.77)
WebP desktop (mobile) 0.17 (0.16) 0.60 (0.57) 1.88 (1.93)
AVIF desktop (mobile) 0.05 (0.11) 0.39 (0.40) 1.16 (1.16)

From 2 to 3 megapixels

bits-per-pixel 10th percentile 50th percentile 90th percentile
JPEG desktop (mobile) 0.38 (0.41) 1.12 (1.14) 3.32 (3.41)
WebP desktop (mobile) 0.12 (0.13) 0.48 (0.46) 1.50 (1.57)
AVIF desktop (mobile) 0.03 (0.08) 0.30 (0.35) 1.03 (1.13)

From 3 to 4 megapixels

bits-per-pixel 10th percentile 50th percentile 90th percentile
JPEG desktop (mobile) 0.31 (0.34) 1.05 (1.06) 2.93 (3.02)
WebP desktop (mobile) 0.03 (0.09) 0.25 (0.35) 1.06 (1.29)
AVIF desktop (mobile) 0.01 (0.04) 0.04 (0.24) 0.57 (0.85)

From 4 to 5 megapixels

bits-per-pixel 10th percentile 50th percentile 90th percentile
JPEG desktop (mobile) 0.39 (0.40) 1.02 (1.03) 2.37 (2.47)
WebP desktop (mobile) 0.06 (0.08) 0.30 (0.35) 1.08 (1.16)
AVIF desktop (mobile) 0.01 (0.06) 0.16 (0.24) 0.73 (0.74)

How to reproduce these results

Please follow the instructions here:
https://github.com/HTTPArchive/httparchive.org/blob/main/docs/gettingstarted_bigquery.md

With a custom query such as:
https://gist.github.com/foolip/34ed26159b17db30abbbe4890200da36

Acknowledgments

Many thanks to Philip Jägenstedt for gathering the data, and to the people behind the Web Almanac effort for their appreciated hard work and for considering the filters above.