Thumbor/GIF

From Wikitech-static
< Thumbor
Revision as of 10:16, 12 October 2017 by imported>Gilles (Created page with "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 cor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 Puppet 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.