The title says it all. When oversized animated gif files are resized, only the first frame is preserved.
After a bit of research, it looks like the solution is to first coalesce the gif before resizing it. This “fills out” the incomplete frames so they can be resized, retaining the animation, by ImageMagick.
Seemingly paradoxically, this usually results in a larger file size than you started with. The coalescing process can be effectively reversed by optimizing the resized gif.
So, we have a few possible solutions:
- Coalesce, resize, then optimize gifs rather than sending them through the same optimization process as other images.
- Allow browsers to resize gifs client side.
- Some more involved process resembling YouTube lazy embeds, where gifs don’t animate until you click / hover them. (See e.g. 9gag.com)
I’m definitely in favor of the first option.