Thumbor/GIF

From Wikitech

Our Thumbor GIF engine reuses the built-in GIF engine, with minor additions.

MAX_ANIMATED_GIF_AREA

We have some huge animated GIFs on our wikis, and rendering their corresponding animated thumbnails would generate very heavy thumbnails. Which is why, when the source animated GIF is over a certain threshold, we render its thumbnail as a static GIF.

The MAX_ANIMATED_GIF_AREA limit, defined in Thumbor's Deployment Charts configuration, is compared against the surface of the GIF multiplied by its frame count.

Color palettes and resizing

Thumbor's GIF engine uses gifsicle, with default parameters. Which means that the color palette of the original image is used as-is for the thumbnail. While this works fine for animated GIFs that are videos in nature, it doesn't work well with schematics. We have a lot of those, and thin lines against plain backgrounds resize poorly if the palette isn't adapted to incorporate new shades of the line and background's colors mixed in. This is solved by our use of the resize-colors gifsicle parameter.