Everything you need to know about GIF
GIF (Graphics Interchange Format, .gif) is the venerable 1987 image format from CompuServe. Originally designed for static images, GIF survived the modern era because of one feature: animation. From early web banners to modern reaction memes, GIF stayed relevant 35+ years past its prime, despite being technically inferior to every modern alternative.
How it works under the hood
- 256 colors max. GIF uses an 8-bit palette - only 256 unique colors per frame. This is why GIFs of complex video look posterized and washed out.
- LZW compression. Lempel-Ziv-Welch lossless compression. The patent on LZW was the entire reason PNG was invented - it expired in 2003.
- Frame-by-frame animation. Each frame is a full or partial image with a delay. Disposal methods control how previous frames are cleared.
- Transparency is binary. A pixel is either fully opaque or fully transparent - no anti-aliasing. Edges of transparent GIFs have visible jaggies.
Where you'll actually use it
- Reaction images and memes (cultural lock-in)
- Simple UI animations on legacy systems
- Email signatures with subtle motion
- Loading spinners on older websites (replaceable by CSS today)
How it compares to alternatives
GIF vs MP4: A typical 'GIF' on Twitter is actually MP4 - 95% smaller, smoother, full color. GIF vs WebP: WebP supports animation with 26-35% smaller files. GIF vs APNG: APNG is GIF with PNG quality - true alpha, full color, native to Firefox.
Things that will trip you up
- Modern 'GIFs' on social media are MP4 videos - the platforms transcode for you
- GIF cannot do partial transparency - you'll get jagged edges on smooth shapes
- A 5-second 1080p GIF is typically 10MB+ - the same content as MP4 is under 500KB