Custom GIF Creator
Create animated GIF images from uploaded frames. Add images, set delays, reorder frames, and export production-quality GIFs entirely in your browser.
About
GIF89a remains the dominant format for short-loop animations across email clients, messaging platforms, and legacy web systems that reject modern video codecs. Producing a valid GIF requires LZW-compressed frame data, a global color table quantized to at most 256 entries, and precise graphic control extension headers that dictate per-frame delay in centisecond units (1 cs = 10 ms). An incorrectly constructed color table or missing Netscape application extension block will produce a static image or a single-play animation. This tool performs real binary GIF89a encoding in the browser using a complete LZW compressor, median-cut color quantization, and Floyd-Steinberg dithering. Limitations: maximum palette depth is 256 colors per frame. Photographic content with smooth gradients will exhibit banding artifacts inherent to the GIF specification.
Formulas
Each frame is quantized from true-color (24-bit RGB) to an indexed 256-color palette. The median-cut algorithm partitions the color space by recursively splitting the longest axis of the bounding box containing pixel colors. Floyd-Steinberg dithering distributes quantization error to neighboring pixels:
pixel(x+1, y) += e × 716
pixel(x−1, y+1) += e × 316
pixel(x, y+1) += e × 516
pixel(x+1, y+1) += e × 116
LZW compression builds a dictionary of pixel index sequences. The initial dictionary contains entries 0 through 2n−1 for the palette, plus a clear code (2n) and end-of-information code (2n+1). Code width starts at n+1 bits and grows as the dictionary expands, resetting at 4096 entries (12-bit maximum).
Where e = quantization error vector (RGB), n = color depth in bits (ceil(log2(paletteSize))), minimum 2.
Reference Data
| Parameter | GIF89a Spec Value | Notes |
|---|---|---|
| Max Colors | 256 | Global or local color table |
| Color Table Size | 21 to 28 | Must be power of 2 |
| Frame Delay Unit | 10 ms (centisecond) | Minimum practical: 20 ms |
| Min Code Size (LZW) | 2 to 8 bits | Derived from color depth |
| Max Image Width | 65535 px | Spec limit; practical limit far lower |
| Max Image Height | 65535 px | Memory-constrained in browsers |
| Loop Count | 0 = infinite | Netscape 2.0 application extension |
| Disposal Method 0 | No disposal | Frame accumulates |
| Disposal Method 1 | Do not dispose | Leave frame in place |
| Disposal Method 2 | Restore to background | Clear frame area |
| Transparency | 1-bit alpha | Single transparent color index |
| LZW Initial Code Size | max(2, colorDepth) | Minimum is 2 bits |
| Sub-block Max Size | 255 bytes | Data split into sub-blocks |
| Header Signature | GIF89a | 6 ASCII bytes |
| Trailer Byte | 0x3B | Marks end of file |
| Typical Web Delay | 100 ms | 10 fps equivalent |
| Smooth Animation | 33 ms | 30 fps equivalent |
| Cinematic Rate | 42 ms | 24 fps equivalent |
| Email-Safe Max Size | 1 MB | Gmail/Outlook rendering limit |
| Social Media Max | 5 - 15 MB | Platform-dependent |