Post

Updating the Wheel of Names Discord bot to generate WebPs instead of GIFs has been a frustrating necessity. This thread will go over the reasons I did this, the impact on our users, and some details about what went into it.

0 reposts0 likes

So first off, why? Discord recently reduced the file upload size limit for free users from 25MB to 10MB. The GIF format is unfortunately very inefficient, and many of the wheel spin GIFs we generated were above 10MB. WebP files are generally significantly smaller than GIFs at comparable quality.

OK, what's the user impact? The most noticeable thing will be that WebP files take longer to encode due to having more sophisticated compression. In general, 10-second spins with >100 entries can take up to 2.5x as long to render. 3-second spins with fewer entries are largely unaffected.

Apart from that, not much will have changed. Some aspects of the image look better than before; some others, a little worse. The Discord client seems to take a bit longer to show the WebP animation than it did to show GIF animation. Hopefully that improves with time.

A lot of things had to change behind the scenes for this. I had to write a new library in Rust (a language I barely know) to interface between our Deno service and the webp-animation Rust crate. I made it as fast as I knew how, but I'm sure there are improvements to be made.