Trivia: Animated GIF Timing

Every now and again, someone reports that Internet Explorer is "slow" when rendering an animated GIF file. Typically, they'll load a lengthy animation in Firefox and IE and note that it runs much more quickly in Firefox. Similarly, Chrome and Safari are "slow" while Opera is "fast." Conversely, there are bug reports against Mozilla complaining that they're rendering "too fast" and should render the image more slowly.

What's going on here? Legacy compatibility with ancient versions of Netscape. An animated GIF specifies its own frame duration internally, but some of the original tools specified extremely low frame-durations (e.g. 0ms) knowing that Netscape would render the image no faster than about 10 frames per second. Therefore, if IE encounters a GIF file with a frame duration of 50ms or fewer (20fps), it will delay the animation to 100ms (10fps).

A sample image (a 2.7MB GIF mislabeled as a JPG) was reported by someone in the community and can be found here.


Update: IE10 Consumer Preview increases the supported frame-rate; frames may be shown with a delay as little as 20ms. If the server specifies a lower delay, the animation is delayed to 100ms for legacy compatibility.