Comment by ashirviskas
2 days ago
You should never use GIF anymore, it is super inefficient. Just do video, it is 5x to 10x more efficient.
2 days ago
You should never use GIF anymore, it is super inefficient. Just do video, it is 5x to 10x more efficient.
There's odd cases where it still has uses. When I was a teacher, some of the gamifying tools don't allow video embeds without a subscription, but I wanted to make some "what 3D operation is shown here" questions with various tools in Blender. GIF sizes were pretty comparable to video with largely static, less-than-a-second loops, and likely had slightly higher quality with care used to reduce color palette usage.
But I fully realize, there are vanishingly few cases with similar constraints.
For those you can often use animated WebP, or even APNG. They all have close to universal support and are usually much smaller.
If you need animated images in emails or text messages, GIF is the only supported format that will play the animation. Because of the size restrictions for these messaging systems the inefficient compression of GIFs is a major issue.
1 reply →
AVIF works here also. Discord started supporting it for custom emoji.
Videos and images are treated very differently by browsers and OS:es. I'm guessing the better suggestion would be to use apng or animated avif if you are looking for a proper gif alternative.
Do browsers support progressive enhancement from gif to animated avif without javascript? The royally messed that up for animated webp.
Yes, by using the <picture> element with <source> elements declaring the individual formats with the last one being a regular <img> with the gif.
Or you could use content-negotiation to only send avif when it's supported, but IMO the HTML way with <picture> is perhaps clearer for the client and end user.
I think the webp problem was due to browsers supporting webp but not supporting animation, transparency or other features, so content negotiation based on mime types (either via <picture> or HTTP content-negotiation) did not work properly. Safari 16.1-16.3 has the same problem with AVIF, but that is a smaller problem than it was with webp.
1 reply →
Unfortunately browser vendors didn't want to support silent looping videos in <img> tags so gif stays relevant.
only if looping information is stored inside the container.