Skip to content

Modern gif replacement: Animated AVIF bugs and performance issues #997

@o-t-w

Description

@o-t-w

Description

Animated AVIF should stand as the modern solution for animated gifs. Unfortunately, implementation in Safari is bug-ridden in general, and all browsers exhibit performance issues around transparency.

Some argue that video is a superior solution for this use case, however, AV1, the most modern video codec, does not support transparency. When using older video codecs, cross-browser differences mean there is no straightforward solution to transparent video on the web. Safari supports VP9, but it does not support VP9 with transparency (bug report). Developers need to export the same video twice: once using the HEVC codec and again using the VP9 codec. VP9 is roughly double the size of AVIF. Animated AVIF, by contrast, does support transparency. <img> has the benefit of alt text and the lazy loading attribute.

Despite being utterly outdated, .gif files remain popular. According to the Web Almanac, in 2024 gif made up almost 17% of all image requests on the web. Usage of .gif actually increased in 2024:

Most surprisingly, the oldest and least efficient format of them all, GIF, picked up a percentage point, too.

image

Developers may not be asking specifically for animated AVIF en masse, but that's an awareness problem. There is clearly a high need for an animated image format and AVIF is increasingly popular.

image

I think part of the reason for the continued popularity of .gif is that the modern alternative is not entirely clear, but that alternative should be animated AVIF. Probably the best option right now is animated WebP but that tends to have larger file sizes than AVIF. Animated JPEG-XL could also potentially be another option, but the implementation of JPEG-XL in Safari does not support animation (even though the spec for JPEG-XL does include animation). The implementation of JPEG-XL in Chrome Canary (behind a flag) suffers from a bad frame rate. Here's the perspective of Jon Sneyers, who worked on the JPEG-XL spec:

image

Specification

https://aomediacodec.github.io/av1-avif/

web-feature

No response

Test Links

No response

Additional Signals

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions