Webp is new and modern format for images which makes images smaller without losing its quality.

Webp also supports animations, and by many reviewers it’s considered as very good alternative to GIF and even APNG
On web you already can find many libraries for converting images to webp and vise versa. I will propose my version as well, but at this time written on Golang. If you already know what is Golang good for you, if not, I suggest read more about it on it’s official page: https://golang.org/

Here is small code snippet to convert GIF animated image to webp animation. It was made possible by importing module: https://github.com/sizeofint/gif-to-webp