3 ms·
Animated PNG vs. Animated Webp vs. GIF
- pornel 6y agoThis is like a comparison which strings and cups make the best telephone. All animation formats are awful, and shouldn't be used for anything larger than an emoji. Normal video codecs are literally 10 times smaller. Even in this article — video capture of these animations playing is smaller than the animations. There's an assumption that animation formats need to exist, because they're simpler and thus lighter, but that's not true. A computer that can play a 4K video will struggle to play a full-HD GIF. Larger anim files require more entropy decoding, and that's a single-threaded CPU-heavy operation. Modern codecs need to decompress only a fraction of the data, and the rest is parallelizable, SIMD-friendly, and often has dedicated hardware acceleration. Sadly, only Safari was smart enough to support MP4 straight in the <img> tag. Other browsers still require cumbersome <video> markup, and Chrome is unwilling to change due to tech debt in their video decoding pipeline (e.g. Chrome can play AV1 in <video> tag smoothly, but the same AV1 payload in an AVIF container will make Chrome gobble up all the RAM and die).