There's always going to be a case of when using the gif file format is perhaps the best choice for the job. Like all things considered, a limited palette, reasonable canvas size, the use of a transparency bit instead of a channel. You still have a chance to use an animated gif that's smaller than both the webm and webp variants. Because while it still is possible to create a lossless webp file, the codec is completely different and will store data significantly different, and in the certain use cases, can be less effecient
How do you create a lossless video from a GIF (or a series of images)? I think I've figured out how to do it for H.264 with ffmpeg, but I don't know how to do it for H.265 or AV1.
The main problem I've been encountering is that everything seems to be based on YUV, which makes it difficult to round-trip RGB data without loss.
Yeah, that's the best solution I've found for truly lossless conversions, but for wide compatibility the only real choices seem to be animated image formats like GIF or APNG.
I started looking for lossless because my screen captures looked like absolute garbage even at high bit rates, but in retrospect, I bet the problem was the downscaling done by the 4:2:0 chroma profile. It might be that 4:4:4 would fix the awful appearance.