Format reference · .gif
What is a GIF?
GIF (Graphics Interchange Format) is a palette-based image format from 1987, best known for short looping animations. Each frame can use at most 256 colors, transparency is on or off per pixel, and it plays almost everywhere, which keeps it alive despite large files.
A short history
CompuServe introduced GIF in 1987 so its online users could exchange images over slow modems. The 1989 revision, GIF89a, added frame delays, a transparent color and room for extensions; a later extension added looping, which is what turned GIF into the web’s animation format.
GIF’s compression, LZW, was patented, and royalty demands in the mid-1990s led directly to the creation of PNG. Those patents expired in the early 2000s, so GIF is free to use today.
How GIF compression works
A GIF doesn’t store colors per pixel. It stores a palette of up to 256 colors and then, for each pixel, the index of a palette entry. Those indexes are compressed with LZW, which replaces repeated sequences with short codes. That step is lossless, so a simple graphic with few colors survives perfectly.
Photos are where GIF struggles. Reducing millions of colors to 256 loses information before compression even starts. Encoders hide this with dithering, a pattern of mixed pixels that fakes in-between shades, but dithered noise is hard for LZW to compress, so the file grows. Smooth gradients often show visible bands.
Transparency and animation
One palette color can be marked as transparent. A pixel is therefore either fully visible or fully see-through, with nothing in between. Anti-aliased edges are blended against a fixed background color when the GIF is made, so a logo prepared for white can show a light halo on a dark page.
An animated GIF is a series of frames, each with its own delay and an instruction for what to do with the previous frame. Frames can cover only the area that changed, and each frame may have its own 256-color palette. Delays are stored in hundredths of a second, and browsers slow down extremely short delays, so very fast GIFs may play slower than intended.
Support and file size
GIF works in every browser, email client, chat app and operating system, and it autoplays wherever images are shown. Many social and messaging platforms quietly convert uploaded GIFs into video files because those are much smaller.
File size is GIF’s weak point. A few seconds of video-like footage can easily run to several megabytes. Animated WebP, AVIF or a short muted video usually deliver the same clip in a fraction of the size with full color. Compress GIF reduces the palette to 128, 64 or 32 colors and can drop every other frame, while keeping the animation intact.
Converting a GIF to another format in Pixellin uses only its first frame, which is useful for grabbing a still image or a thumbnail.
Use GIF for
- Short reaction loops and memes that must play everywhere
- Simple animated icons and loading spinners with few colors
- Email newsletters, where video and newer formats are unreliable
- Pixel art with a limited palette
Avoid GIF for
- Photos or anything with smooth gradients
- Long or video-like clips, which produce huge files
- Graphics that need soft, semi-transparent edges
- Modern websites, where animated WebP or video is far smaller
GIF questions
Why are animated GIFs so large?
Each frame is compressed separately with an older lossless method, there is no motion prediction between frames as in video, and dithering adds noise that compresses poorly. A clip that would be a few hundred KB as video can be several MB as a GIF.
Can a GIF have more than 256 colors?
Each frame’s palette is limited to 256 colors. Because every frame can have its own palette, some encoders split a still image into tiles that each use a different palette, but this is rare, increases file size, and isn’t well supported by editors. For full color, use PNG, WebP or JPG.
How do I make a GIF smaller?
Reduce the number of colors, cut frames, shorten the clip or reduce its dimensions. Fewer colors and frames make the biggest difference. Pixellin’s GIF compressor offers 128, 64 and 32 color palettes and optional frame dropping, and keeps the file animated.
Is GIF lossless?
The compression step is lossless, so a graphic that already uses 256 colors or fewer is stored exactly. Converting a photo to GIF is lossy in practice, because its colors must first be reduced to a palette of 256 or fewer.