Today Apple published lists of new features available with iOS 17 (to be released September 18) and macOS 14 (to be released September 26). One of those features caught my eye. Indeed it made my eyes bulge.
Automatically pause animated images. Pause animated images by default, such as GIFs in Messages and Safari for your visual comfort.
This is astounding news! In my opinion, the feature should have been highlighted in the WWDC keynote. It's that huge. And I'm going to take a little personal credit for it (whether that's justified or not, heh). Over the years, a number of my customers have requested such a feature for my web browser extension StopTheMadness. Unfortunately, however, there's no direct JavaScript access to image decoders or formats for HTML <img> elements, which makes it extremely difficult for me to implement GIF blocking in my extension. That's why I filed a bug with Apple's WebKit project, the open source web browser engine underlying Safari. My bug was titled Animated images ignore user's prefers-reduced-motion and Auto-Play preferences. So there you have it. You're welcome! ;-)
Let's look at where the new feature can be found and how it works. First, in macOS 14 Sonoma. For some reason, Apple buried the feature in the "Accessibility" section of System Settings. If it were me, I would put it in a section called "Annoyances". On the other hand, all of System Settings is annoying, so maybe that's not specific enough. In the Display subsection of the Accessibility section, there's a toggle titled "Auto-play animated images".

You want to disable that setting.

Now let's look at an animated GIF in Safari. Here's an article about the 30th anniversary of the GIF. With the new system setting disabled, the GIF does not animate. Hooray! You can still manually make it animate by selecting the "Play Animation" menu item from the contextual menu.

And then you can stop the animation again by selecting "Pause Animation".

It would be better if you could just click the image to play and pause the animation, but the contextual menu is certainly way better than nothing! More than 30 years of nothing… until now.
The feature works similarly in iOS 17 and iPadOS 17. It's again in the Accessibility section of Settings, although here it's in the Motion subsection rather than the Display & Text Size subsection.

For some reason, on iOS the same Vox page uses an HTML <video> for the first animated "image" rather than an animated GIF, so we'll look at an <img> element further down the page.

Again, there are "Play Animation" and "Pause Animation" items in the contextual menu.

I would say that by itself, this new "Accessibility" feature is reason enough to update to iOS 17 and macOS 14. I'm very excited! It's one of the best new features in ages (and sorely overdue).
It turns out that disabling "Auto-Play Animated Images" also fixes a problem I blogged about last year: an HTML <video> element can be used as the src attribute of an <img> element or even as the poster attribute of another <video> in Safari, and that src or poster video will autoplay even if the user has video autoplay disabled!
As I wrote to Apple engineers in my WebKit bug report, "Seriously, if Safari shipped click-to-play animated gifs, you might get more public praise than you've ever heard in your life." Let me be the first to praise you! Thank you very much for shipping this feature. (It's not precisely click-to-play, but close enough.)
By the way, I seem to have found a bug in Sonoma System Settings where the "Auto-play animated images" toggle button appears to be enabled after it has been disabled. This happens when you quit and relaunch the System Settings app. The bug does not occur in the iOS 17 Settings app.