diff --git a/src/config/2024.json b/src/config/2024.json
index d169e2f5278..886c7540df9 100644
--- a/src/config/2024.json
+++ b/src/config/2024.json
@@ -41,8 +41,7 @@
"part": "I",
"chapter_number": "5",
"title": "Media",
- "slug": "media",
- "todo": true
+ "slug": "media"
},
{
"part": "I",
diff --git a/src/config/contributors.json b/src/config/contributors.json
index e9ed04914da..d6fc5c656c1 100644
--- a/src/config/contributors.json
+++ b/src/config/contributors.json
@@ -1490,6 +1490,7 @@
},
"eeeps": {
"avatar_url": "3441390",
+ "bluesky": "ericportis.com",
"github": "eeeps",
"name": "Eric Portis",
"teams": {
@@ -1506,6 +1507,10 @@
"2022": [
"analysts",
"authors"
+ ],
+ "2024": [
+ "analysts",
+ "authors"
]
},
"twitter": "etportis",
@@ -4283,6 +4288,20 @@
},
"twitter": "SophieBrannon"
},
+ "stefanjudis": {
+ "avatar_url": "962099",
+ "bluesky": "stefanjudis.com",
+ "github": "stefanjudis",
+ "name": "Stefan Judis",
+ "teams": {
+ "2024": [
+ "analysts",
+ "authors"
+ ]
+ },
+ "twitter": "stefanjudis",
+ "website": "https://www.stefanjudis.com"
+ },
"smatei": {
"avatar_url": "17740806",
"github": "smatei",
diff --git a/src/config/last_updated.json b/src/config/last_updated.json
index 63da8b04e17..823971a3f37 100644
--- a/src/config/last_updated.json
+++ b/src/config/last_updated.json
@@ -802,8 +802,8 @@
"hash": "104af3db925b127c2faa046054ccb8f1"
},
"en/2024/chapters/media.html": {
- "date_published": "2024-11-11T00:00:00.000Z",
- "date_modified": "2024-11-16T00:00:00.000Z",
+ "date_published": "2024-12-29T00:00:00.000Z",
+ "date_modified": "2024-12-29T00:00:00.000Z",
"hash": "bf161425b410d139228aa5c199eb251b"
},
"en/2024/chapters/mobile-web.html": {
diff --git a/src/content/en/2024/media.md b/src/content/en/2024/media.md
index d2b605fce9d..8dcd6a20285 100644
--- a/src/content/en/2024/media.md
+++ b/src/content/en/2024/media.md
@@ -3,17 +3,874 @@
title: Media
description: Media chapter of the 2024 Web Almanac covering how images and videos are currently being encoded, embedded, styled, and delivered on the web.
hero_alt: Hero image of Web Almanac characters projecting an image onto a screen while other Web Almanac characters walk to cinema seats with popcorn to watch the projection.
-authors: []
-reviewers: []
-editors: []
-analysts: []
+authors: [stefanjudis, eeeps]
+reviewers: [svgeesus]
+editors: [MichaelLewittes]
+analysts: [stefanjudis, eeeps]
translators: []
+stefanjudis_bio: Stefan Judis fell in love with Frontend development ten years ago, and learns in public on his blog and newsletter.
+eeeps_bio: Eric Portis is a Web Platform Advocate at Cloudinary.
results: https://docs.google.com/spreadsheets/d/1Q2ITOe6ZMIXGKHtIxqK9XmUA1eQBX9CLQkxarQOJFCk/
-featured_quote:
-featured_stat_1:
-featured_stat_label_1:
-featured_stat_2:
-featured_stat_label_2:
-featured_stat_3:
-featured_stat_label_3:
+featured_quote: Images on the web are getting bigger. Whether you're counting image pixels or layout dimensions, the numbers are going up. So even though we also saw an increase in compression ratios—driven in part by increased adoption of modern image formats—total image byte sizes are going up, too.
+featured_stat_1: 99.9%
+featured_stat_label_1: Pages that requested at least one image resource.
+featured_stat_2: 32%
+featured_stat_label_2: Increase in video adoption since 2022.
+featured_stat_3: 1 in 5
+featured_stat_label_3: Inaccurate `sizes` attributes.
+doi: 10.5281/zenodo.14552631
---
+
+## Introduction
+
+Images and videos are everywhere on the web. However, the ways they're encoded and embedded on web pages are surprisingly varied and complex, and best practices are always evolving. The Web Almanac gives us a chance to take stock of that complexity and how well we're managing it, giving us a zoomed-out, panoramic view of where media on the web is, how far it has come, and—just maybe—where it is going. So, let's go!
+
+## Images
+
+We'll kick off with the most common media type—images. How often do you look at a web page without images? For us, it is extremely rare and if there are no images, we're most likely looking at a nerdy developer blog.
+
+It comes at no surprise that of the more than 10 million scanned and parsed pages, 99.9% requested at least one image.
+
+{{ figure_markup(
+ caption="Pages that requested at least one image resource.",
+ content="99.9%",
+ classes="big-number",
+ sheets_gid="186748113",
+ sql_file="at_least_one_image_request.sql"
+)
+}}
+
+Almost every page serves up some kind of an image, even if it's just a background or favicon.
+
+How many `` elements did we find, per page?
+
+{{ figure_markup(
+ image="img-elements-per-page.png",
+ caption="Count of `` elements per page.",
+ description="Bar chart showing the distribution of counts of image elements per page on desktop and mobile. There is little difference between them (mobile is consistently slightly lower). At the 10th percentile, both mobile and desktop pages contain 1 image, at the 25th percentile it's 5 on mobile and 6 on desktop, at the 50th it's 13 and 14, at the 75th it's 29 and 32, and at the 90th percentile it's 56 and 62.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=796561224&format=interactive",
+ sheets_gid="76384810",
+ sql_file="imgs_per_page.sql"
+)
+}}
+
+The median mobile page contains 13 `` elements. And even at the 90th percentile, pages "only" contain 56 ``s. Considering the visual nature of today's web, this seems reasonable.
+
+If you think that 56 ``s per page is a lot, we probably shouldn't tell you that the mobile crawler found a page with more than two thousand `` elements.
+
+{{ figure_markup(
+ content="2,174",
+ caption="Most `` elements on a single page (mobile).",
+ classes="big-number",
+ sheets_gid="76384810",
+ sql_file="imgs_per_page.sql"
+)
+}}
+
+Images aren't just pervasive and plentiful. Most of the time they are also a central part of users' experiences. One way to measure that is to see how often images are responsible for pages' Largest Contentful Paint.
+
+{{ figure_markup(
+ content="68%",
+ caption="Mobile pages whose LCP responsible element has an image.",
+ classes="big-number",
+ sheets_gid="2001439429",
+ sql_file="lcp_element_data.sql"
+)
+}}
+
+It's hard to overstate the importance of images on the web. So, let's find out what we're dealing with!
+
+### Image resources
+
+We'll start with the resources themselves. Most images are made of pixels (let's ignore vector images for a moment). How many pixels do the web's images typically have?
+
+Perhaps surprisingly, many images contain just a single pixel!
+
+#### Single-pixel images
+
+
+
+
+
+
Client
+
1×1 images
+
+
+
+
+
Mobile
+
6.4%
+
+
+
Desktop
+
6.0%
+
+
+
+ {{ figure_link(caption="Resources loaded by `` elements that contain just a single pixel.", sheets_gid="297753608", sql_file="image_1x1.sql") }}
+
+
+One-by-one pixel images make up roughly 6% of all of the captured image requests. These are most likely tracking beacons and spacer GIFs as discovered in [last year's Media chapter](../2022/media#a-note-on-single-pixel-images). And looking back, we're happy to report some good news: the percentage of single-pixel images has declined a full point since 2022. So maybe old habits are slowly being replaced with [newer and better alternatives](https://developer.mozilla.org/docs/Web/API/Beacon_API).
+
+### Image dimensions
+
+Let's now turn to images that were larger than 1×1. How big were they?
+
+{{ figure_markup(
+ image="image-pixel-count-distribution.png",
+ caption="Distribution of image pixel counts.",
+ description="Bar chart showing the distribution of pixels per image on desktop and mobile, but there is effectively no difference between them, except at the 90th percentile. At the 10th percentile, mobile images contain 0.001 megapixels, at the 25th percentile, 0.013, at the 50th, 0.058, at the 75th, 0.262, and at the 90th percentile mobile images contain 0.778 megapixels. The bar for desktop at the 90th percentile reaches a little higher, to over 0.85 megapixels.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=71466048&format=interactive",
+ sheets_gid="1417829992",
+ sql_file="bytes_and_dimensions.sql"
+)
+}}
+
+Despite the fact that the Web Almanac's mobile crawler hasn't grown at all (rendering pages to a 360px-wide viewport, at a device pixel ratio of 3x), the median image—weighing in at 0.058 megapixels—is about 25% larger than it was [the last time we looked](../2022/media#image-dimensions). For reference, at a square aspect ratio, 0.058 megapixels works out to about 240×240.
+
+Most pages have one image that has almost 10 times as many pixels as the median image:
+
+{{ figure_markup(
+ image="largest-image-per-page.png",
+ caption="Largest image per page (by pixel count).",
+ description="Bar chart showing the distribution of largest image per page, by pixels. Only the mobile bars are labelled. At the 10th percentile, mobile pages' largest image contains 0.023 megapixels. At the 25th percentile it's 0.138 megapixels, at the 50th it's 0.540 megapixels, at the 75th it's 1.280, and at the 90th percentile it's 3.130 megapixels. The first two desktop bars are about the same, but at the 50th percentile, they start to reach up to 1.25x higher.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=1868037089&format=interactive",
+ sheets_gid="1057576785",
+ sql_file="largest_image_per_page_pixels.sql"
+)
+}}
+
+At a square aspect ratio, 0.54 megapixels works out to 735×735. Given the mobile crawler's viewport and density, it is quite likely that many pages have one "hero" image that is being displayed full-width at high density.
+
+As for the 50% of pages that sent images even larger than that, they are almost certainly sending the mobile crawler more pixels than it can actually display, and could have prevented that waste with some well-written responsive image markup. But more on that later.
+
+### Image aspect ratios
+
+Now that we have some sense of how images on the web are sized, how are they shaped?
+
+{{ figure_markup(
+ image="image-orientations.png",
+ caption="Image orientations.",
+ description="A pair of stacked bars showing what percentage of images are portrait-oriented, landscape-oriented, and square, on both desktop and mobile. The desktop breakdown is: 13% portrait, 33% square, and 54% landscape. The mobile breakdown is: 14% portrait, 33% square, and 53% landscape.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=774294848&format=interactive",
+ sheets_gid="60298066",
+ sql_file="portrait_landscape_square.sql"
+)
+}}
+
+Most images are wider than they are tall—only 1 in 8 are taller than they are wide and a full one-third are exactly square. Square is by far the most popular exact aspect ratio:
+
+
+
+This data is essentially unchanged from two years ago. It still seems to indicate a bias towards desktop-based browsing—creators are missing opportunities to fill portrait-oriented mobile screens with big, beautiful, portrait-oriented imagery.
+
+### Image color spaces
+
+The range of colors that are possible within a given image is determined by that image's [color space](https://wikipedia.org/wiki/Color_space). The default color space on the web is [sRGB](https://wikipedia.org/wiki/SRGB). Unless images signal that their color data uses a different color space, browsers will use sRGB.
+
+The traditional way to explicitly assign a color space to an image is to embed an [ICC profile](https://wikipedia.org/wiki/ICC_profile) within it. We looked at all of the ICC profiles embedded in all of the images crawled in the dataset.
+
+Here are the top ten:
+
+
+
+The vast majority of the web's images rely on the sRGB default for correct rendering and don't contain any ICC profile at all.
+
+The most common ICC profile is the full, official sRGB color profile. This profile is relatively heavy—it weighs 3 KB. Thus, most of the rest of the top 10 ICC profiles are "sRGB-ish" profiles like Clinton Ingrahm's 424-byte c2ci, which unambiguously specify that an image uses sRGB but with a minimum of overhead.
+
+Over the last decade, hardware and software are increasingly able to capture and present colors that are outside of the range of colors that are possible with sRGB (aka the sRGB [gamut](https://wikipedia.org/wiki/Gamut)). Adobe RGB (1998) and Display P3 are the only two "wide-gamut" profiles in the top 10. [While Adobe RGB (1998)'s usage ticked down slightly from 2022, Display P3's has ticked up](../2022/media#fig-8), and total wide-gamut ICC profile adoption is up about 10% in relative terms. In absolute terms, wide-gamut ICC profiles are still relatively rare. We found them in 1 in 80 images on the web and 1 in 10 images that have an ICC profile.
+
+One very important caveat here is that in our analysis we were only able to look at ICC profiles. As mentioned, these profiles can be relatively heavy. Modern image formats like AVIF (and recently modernized ones like PNG) allow images to signal their color space much more efficiently using a standard called CICP—which allows common color spaces to be signaled in just four bytes. It stands to reason that modern PNG encoders and any AVIF encoder worth its salt would use CICP instead of ICC to signal a wide gamut color space.
+
+However, in our analysis, images containing CICP are categorized under "No ICC profile." So, our accounting of wide-gamut usage on the web should be seen as a floor, rather than as an estimate of total adoption. In other words, we found that at least 1 in 80 images on the web is wide-gamut.
+
+## Encoding
+
+Now that we've gleaned a bit about the web's image content, what can we say about how that content is encoded for delivery?
+
+### Format adoption
+
+For decades there were just three bitmap formats in common use on the web: JPG, PNG, and GIF. They are still the three most common formats:
+
+{{ figure_markup(
+ image="image-format-adoption-mobile.png",
+ caption="Image format adoption (mobile).",
+ description="A pie chart breaking down each format's share of the web's images. JPEG comes in first, at 32.4%. Next, we have PNG, at 28.4%, GIF, at 16.8%, WebP at 12%, SVG, at 6.4%, and other/unkonwn, at 1.7%. A couple of tiny slivers of the pie are left unlabeled, but hovering them reveals ICO at 1.3% and AVIF at 1.0%.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=424926454&format=interactive",
+ sheets_gid="1939630368",
+ sql_file="media_formats.sql"
+)
+}}
+
+But we are happy to report that change is happening. The largest single absolute change in usage since 2022 was from JPEG, which fell from 40% of all images in 2022 down eight full percentage points to 32% in 2024. That's a huge loss over two years.
+
+Which formats saw more usage to make up the difference? WebP picked up three percentage points, SVG picked up a bit under two percentage points, and AVIF picked up almost a full point. Most surprisingly, the oldest and least efficient format of them all, GIF, picked up a percentage point, too.
+
+And in relative terms, AVIF usage is taking off—we found almost four times more AVIFs served up by the crawled pages than we did two years ago.
+
+{{ figure_markup(
+ image="image-format-adoption-2-year-change-mobile.png",
+ caption="Image format adoption, 2-year change (mobile).",
+ description="A bar chart showing the relative 2-year change in format adoption, for seven image formats. JPEG saw a 20% decrease, PNG a 1% increase, GIF a 6% increase, WebP a 34% increase, SVG a 36% increase, ICO a 17% decrease, and finally AVIF saw a 386% increase.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=2128858223&format=interactive",
+ sheets_gid="1939630368",
+ sql_file="media_formats.sql"
+)
+}}
+
+If the crawler had accepted JPEG XLs, we probably would have seen a fair number of them as well. Alas, Chromium-based browsers don't support the format.
+
+Almost all of the JPEGs, PNGs, and GIFs on the web would be better-served using a modern format. WebPs are good, but AVIFs and JPEG XLs are even better. It is nice to see the massive ship that is all-of-the-images-on-the-web slowly but surely turning towards these more efficient formats. And it's nice to see SVG usage tick upwards, too!
+
+Lastly, a few words for the oldest format of the bunch: "Burn All GIFs" was good advice in 1999, and it is even better advice today. Developers should take Tyler Sticka's advice about how to replace the 37-year-old format.
+
+### Byte sizes
+
+How heavy is the typical image on the web?
+
+{{ figure_markup(
+ image="distribution-of-image-byte-sizes.png",
+ caption="Distribution of image byte sizes.",
+ description="A bar chart showing the distribution of image byte sizes on both desktop and mobile, though only the mobile bars are labelled and there is little difference between the desktop and mobile numbers. At the tenth percentile it's 0 kilobytes, at the 25th percentile it's 2 KB, at the 50th percentile it's 12 KB, at the 75th percentile it's 56 KB, and finally, at the 90th percentile it's 177 KB.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=1659171071&format=interactive",
+ sheets_gid="1417829992",
+ sql_file="bytes_and_dimensions.sql"
+)
+}}
+
+A median of 12 KB might lead one to think, "Eh, that's not that heavy!" But, just as when we looked at pixel counts, we found that most pages contain many small images, and at least one large one.
+
+{{ figure_markup(
+ image="largest-image-per-page-by-kilobytes.png",
+ caption="Largest image per page (by kilobytes).",
+ description="Bar chart showing the distribution of largest image per page, by kilobytes. The chart shows bars for both desktop and mobile, although only the mobile bars are labelled. The desktop number all appear about 10-20% larger. At the 10th percentile, the largest image per page on mobile weighs 6 KB, at the 25th percentile, it's 37 KB, at the 50th percentile, it's 135 KB, at the 75th percentile, it's 404 KB, and at the 90th percentile, it's 1002 KB.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=2122518926&format=interactive",
+ sheets_gid="117141741",
+ sql_file="largest_image_per_page_bytes.sql"
+)
+}}
+
+Most mobile pages have one image that's 135 KB or more. That's an 8% increase since 2022. And the further up we go in the distribution, the more things are accelerating: the 75th percentile is up 10% and the 90th percentile is up 13% (to almost exactly a megabyte).
+
+Images are getting heavier, and the heaviest images are getting heavier faster.
+
+### Bits per pixel
+
+Bytes and pixel counts are interesting on their own, but to get a sense of how compressed the web's image data is we need to put bytes and pixels together to calculate bits per pixel. Doing this allows us to make apples-to-apples comparisons of the information density of images, even if those images have different resolutions.
+
+In general, bitmaps on the web decode to eight bits of uncompressed information per channel (per pixel). So, if we have an RGB image with no transparency, we can expect a decoded, uncompressed image to weigh in at 24 bits per pixel.
+
+A good rule of thumb for lossless compression is that it should reduce file sizes by a 2:1 ratio (which would work out to 12 bits per pixel for our 8-bit RGB image). The rule of thumb for 1990s-era lossy compression schemes—JPEG and MP3—was a 10:1 ratio (2.4 bits per pixel).
+
+It should be noted that, depending on image content and encoding settings, these ratios vary widely and modern JPEG encoders like MozJPEG and Jpegli typically outperform this 10:1 target at their default settings.
+
+To summarize:
+
+
+
+
+
+
Type of bitmap data
+
Expected compression ratio
+
Bits per pixel
+
+
+
+
+
Uncompressed RGB
+
1:1
+
24 bits/pixel
+
+
+
Losslessly compressed RGB
+
~2:1
+
12 bits/pixel
+
+
+
1990s-era lossy RGB
+
~10:1
+
2.4 bits/pixel
+
+
+
+ {{ figure_link(caption="Typical compression ratios and resulting bits per pixel numbers for bitmap RGB data." ) }}
+
+
+So, with all of that as context, here's how the web's images stack up:
+
+{{ figure_markup(
+ image="distribution-of-image-bits-per-pixel.png",
+ caption="Distribution of image bits per pixel.",
+ description="A bar chart showing the distribution of image bits per pixel, for both desktop and mobile. The desktop bars are consistently ever-so-slightly shorter than the mobile ones, but are unlabelled. At the tenth percentile, the web's images weigh in at 0.1 bits per pixel for mobile. At the 25th, 0.9, at the 50th, 2.1, at the 75th, 5.6, and finally, at the 90th percentile, mobile images weigh in at a whopping 12.9 bits per pixel.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=400614419&format=interactive",
+ sheets_gid="1417829992",
+ sql_file="bytes_and_dimensions.sql"
+)
+}}
+
+The median image is compressed to 2.1 bits per pixel, representing a tad more compression than that 1990s rule of thumb. This is also [8–10% more compression than we saw when we last surveyed the web's images in 2022](../2022/media#fig-14).
+
+When we break compression down by format, we can see that every format saw fewer bits spent per pixel in 2024 than they did in 2022—except for one.
+
+#### Bits per pixel by format
+
+{{ figure_markup(
+ image="median-bits-per-pixel-by-format.png",
+ caption="Median bits per pixel by format.",
+ description="A bar chart showing the median bits per pixel, by format, for a number of popular image formats. The desktop and mobile numbers are similar and only the mobile bars are labelled. GIF weighs in at 6.7 bits per pixel, PNG: 3.8, JPG: 2.0, AVIF: 1.4 and WebP is smallest at 1.3 bits per pixel.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=165542730&format=interactive",
+ sheets_gid="1416380443",
+ sql_file="bytes_and_dimensions_by_format.sql"
+)
+}}
+
+[Compared to 2022](../2022/media#fig-15), on mobile, the median PNG is compressed about 10% more, the median WebP is compressed about 7% more, and the median JPEG is compressed around 3% more. It is hard to know exactly what the causes are here, but we hypothesize that an increase in compression is the result of wider adoption of two things: modern encoders, which provide more bang for the buck, and automated image-processing pipelines, which ensure that every image that makes its way to a user has been well-compressed.
+
+The one format that bucked this trend was AVIF. The median AVIF's bits-per-pixel went up from approximately 1.0 in 2022 to around 1.4 bits per pixel in 2024—an increase of 47%. Funnily enough, we hypothesize the same root cause. The current, diverse crop of AVIF encoders is likely making different quality/filesize tradeoffs, sacrificing less quality at default settings than AOM's official libavif encoder was two years ago.
+
+We have no idea why GIFs got significantly more efficient, but we do know why they are so much less-compressed than all of the other formats. Our query is per pixel, and it does not take animated images into account, though many GIFs are animated!
+
+### GIFs, animated and not
+
+How many GIFs are animated?
+
+{{ figure_markup(
+ content="32%",
+ caption="Percentage of GIFs that were animated on mobile.",
+ classes="big-number",
+ sheets_gid="501019705",
+ sql_file="animated_gif_count.sql"
+)
+}}
+
+When we separate the animated GIFs out from the animated ones, we can see that the median non-animated GIF is much more reasonably compressed:
+
+{{ figure_markup(
+ image="gif-bits-per-pixel-animated-non-animated.png",
+ caption="GIF bits per pixel: animated vs. non-animated.",
+ description="A bar chart showing the distribution of bits per pixel for animated vs non-animated GIFs. The animated GIF bars tower over the non-animated GIF bars. Animated GIFs weigh in at 4.5, 12.1, 32.6, 60.6, and 82.6 bits per pixel, at the 10th, 25th, 50th, 75th, and 90th percentiles, respectively. The non-animated gif progression is as follows: 0.9, 1.8, 3.5, 5.7, and 9.3 bits per pixel.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=1948267327&format=interactive",
+ sheets_gid="1251617650",
+ sql_file="animated_gif_bpp.sql"
+)
+}}
+
+3.5 bits per pixel is even less than the median PNG!
+
+Turning to look at the animated GIFs specifically: How many frames do they have?
+
+{{ figure_markup(
+ image="distribution-of-animated-gif-frame-counts.png",
+ caption="Distribution of animated GIF frame counts.",
+ description="Bar chart showing the distribution of animated GIF frame counts. The chart shows both desktop and mobile, but only the mobile numbers are labelled. The bars look exactly the same until the 90th percentile. At the 10th percentile, both mobile and desktop saw 4 frames per GIF. At the 25th percentile they're both 8 frames. At the 50th they're both 12 frames, at the 75th they're both 24 frames. Lastly, at the 90th percentile, the desktop crawler saw 46 frames, and the mobile crawler saw 60.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=230229356&format=interactive",
+ sheets_gid="810988388",
+ sql_file="animated_gif_framecount.sql"
+)
+}}
+
+Generally: 10 to 20, [which is more or less unchanged since 2022](../2022/media#fig-18), although the longest GIFs have gotten longer, especially on mobile.
+
+Just for fun, we also looked at the GIF with the most frames:
+
+{{ figure_markup(
+ content="54,028",
+ caption="The highest GIF frame count in the data set.",
+ classes="big-number",
+ sheets_gid="810988388",
+ sql_file="animated_gif_framecount.sql"
+)
+}}
+
+At 24-frames-per-second, that would take more than 37 minutes to play once through. Every animated GIF should probably be a video these days, but this one definitely should.
+
+## Embedding
+
+Now that we have a sense of how the web's image resources have been encoded, what can we say about how they are embedded on websites?
+
+### Lazy-loading
+
+The biggest recent change in how images are embedded on websites has been the rapid adoption of lazy-loading. Lazy-loading was introduced in 2020, and just [two years later it was adopted on almost a quarter of websites](../2022/media#lazy-loading). Its climb continues, and it is now used on a full one-third of all websites:
+
+{{ figure_markup(
+ image="adoption-of-img-loading-lazy.png",
+ caption="Adoption of ``.",
+ description="A line chart showing the percent of pages using native lazy-loading, over time, for both mobile and desktop. The lines are pretty close to one another, and rise almost linearly (with a little big of wiggle/jiggle), from just under 25% in June of 2022, to just under 35% in June of 2024. The steepest gain in any one month is right at the end, where there's a sharp little uptick.",
+ chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vQCSP87WE9bhFjIICxcrpIEGQlz3xBq33-ODZ8e91XSLUbLvAZjk25GhOdDtFIZCzPcS-VrSygr7pmz/pubchart?oid=1997305111&format=interactive",
+ sheets_gid="228292115",
+ sql_file="lazy_loading_adoption_over_time.sql"
+)
+}}
+
+And, just like last year, it seems pages are using lazy-loading a bit too much:
+
+{{ figure_markup(
+ content="9.5%",
+ caption="Percentage of LCP-responsible `` elements that use native lazy-loading on mobile.",
+ classes="big-number",
+ sheets_gid="2001439429",
+ sql_file="lcp_element_data.sql"
+)
+}}
+
+Lazy-loading the LCP element is [an anti-pattern that makes pages much slower](https://web.dev/articles/lcp-lazy-loading). While it is disheartening that nearly one-in-ten LCP-responsible ``s are lazy-loaded, we are happy to report that things have improved ever-so-slightly over the last two years. The percentage of offending sites has decreased by 0.3 percentage points since 2022.
+
+### `alt` text
+
+Images embedded with `` elements are supposed to be contentful. That is to say: They're not just decorative, and they should contain something meaningful. According to both WCAG requirements and the HTML spec, most of the time, `` elements should have alternative text, and that alternative text should be supplied by the `alt` attribute.
+
+{{ figure_markup(
+ content="55%",
+ caption="Percentage of images that had a non-blank `alt` attribute.",
+ classes="big-number",
+ sheets_gid="694600230",
+ sql_file="image_alt.sql"
+)
+}}
+
+Unfortunately, 45 percent of `` elements don't have any `alt` text. Worse, the [in-depth analysis from this year's accessibility chapter](./accessibility#images) indicates that many of the ``s that do have `alt` text aren't all that accessible either since their attributes only contain filenames or other meaningless, short strings.
+
+There has been a one percentage point increase in `alt` text deployment since 2022, but still we can—and must—do better.
+
+### `srcset`
+
+Prior to lazy-loading, the biggest thing to happen to `` elements on the web was a suite of features for "responsive images," which allowed images to tailor themselves to fit within responsive designs. First shipped in 2014, the `srcset` attribute, the `sizes` attribute, and the `