Calculator Notes: Frames, Delays and Loop Length

If you make your own reaction GIFs, a little arithmetic helps you control timing and size. This page explains the three calculations that matter most, with worked examples. All the numbers in the examples are illustrative.

Calculation 1: Loop length

In the GIF format, each frame has a delay value, stored in hundredths of a second. Many editors show it in milliseconds or seconds instead.

Loop length (seconds) = number of frames × frame delay (seconds)

Example: a clip with 24 frames, each shown for 0.08 seconds, lasts 24 × 0.08 = 1.92 seconds per loop.

If frames have different delays, for example a longer pause on the final expression, add the delays together instead.

Calculation 2: Hitting a target duration

Reactions usually work best between one and three seconds. If you know how long you want the loop to be, you can work out how many frames you can afford at a given delay.

Frames needed = target length ÷ frame delay

Example: for a 2-second loop at 0.1 seconds per frame, you need 2 ÷ 0.1 = 20 frames. If your source has 40 frames for that moment, dropping every other frame keeps the duration while halving the frame count.

A practical note: some browsers and apps treat very small delays specially, slowing them down to a default. If your GIF plays slower than expected, an extremely short delay may be the reason.

Calculation 3: A rough file-size ceiling

GIF frames store one palette index per pixel, typically one byte each before compression. This gives a rough upper estimate of the raw image data:

Raw data (bytes) ≈ width × height × frames

Example: a 320 × 240 clip with 20 frames gives 320 × 240 × 20 = 1,536,000 bytes, about 1.5 MB before compression. GIF's built-in compression usually reduces this, sometimes a lot for flat cartoons and less for grainy footage. Many editors also store only the changed parts of each frame, which helps further.

The point of the estimate is comparison: halving the width and height cuts the raw data to a quarter. Reducing frames cuts it proportionally. For a reaction that will be viewed at thumbnail size in a chat bubble, shrinking dimensions is usually the least noticeable saving, because nobody sees the extra detail anyway.

Putting it together

ChangeEffect on loop lengthEffect on raw size
Halve the frames, double the delayNoneHalved
Halve width and heightNoneQuartered
Trim frames from the endsShorterSmaller

Limits

See also our flash-rate notes and the glossary.