How to Set Variable Frame Delays in an Animated GIF

Animated GIFs do not require a fixed frame rate; instead, each frame within the file can display for a completely unique length of time. This capability is built directly into the GIF89a format specification, which assigns an independent delay parameter to every individual image frame. This article explains the underlying mechanism that enables variable frame durations, how modern software sets these delays, and the technical limitations to keep in mind when designing multi-speed animations.

The GIF89a Specification and the Graphic Control Extension

The ability to vary frame timing relies on the GIF89a format standard. In an animated GIF, each graphic frame is preceded by a block of metadata known as the Graphic Control Extension (GCE).

The GCE contains specific control parameters for the frame that follows it, including:

Because a separate GCE block is embedded directly before every individual frame in the data stream, the delay time is evaluated on a per-frame basis rather than globally across the file.

How Frame Delay Is Measured

The delay time in the Graphic Control Extension is measured in hundredths of a second (centiseconds). For example:

By defining a value of 10 for dynamic frames and 200 for a pause on a specific title card or reaction shot, creators can emphasize specific moments without needing to duplicate identical frames.

Methods for Implementing Variable Delays

Different software applications expose these GCE delay values in distinct ways:

Browser Handling and Minimum Delay Caps

While the standard allows a delay value of 0, modern web browsers and image viewers enforce minimum delay thresholds to prevent excessive CPU usage and rendering crashes.

Most major browsers (such as Chrome, Firefox, and Safari) will automatically overwrite delays that are set below 20 milliseconds (a value of 0 or 1), artificially slowing them down to a fallback speed of 100 milliseconds (10 frames per second). To ensure smooth playback and avoid unexpected browser throttling, frame delays should generally be kept at or above 2 centiseconds (20 milliseconds).