CompuServe Graphics Interchange Format

.gif · Images

GIF (Graphics Interchange Format) is the oldest image format still in daily use on the web. Today it means almost exclusively short looping animations: reactions, memes, product demos, loading spinners. Still images in GIF are rare and mostly come from old websites. Worth knowing: many apps and GIF libraries only call their clips GIFs and actually deliver MP4 or WebP video, because a real GIF is many times larger.

History: CompuServe, Netscape and a patent

CompuServe released GIF in 1987 (version 87a) so that its online service could send colour images to any computer. Version 89a in 1989 added the extensions that matter today: a delay between frames, a transparent colour and blocks for application data. The endless loop came from Netscape: Navigator 2.0 introduced an application extension called NETSCAPE2.0 with a repeat count, and every browser has honoured it since. The compression, LZW, was patented by Unisys. When licence fees were announced in 1994, developers responded by creating PNG. The US patent expired in June 2003, the European and Japanese ones in June 2004, so GIF is free today. The creator, Steve Wilhite, always said it is pronounced “jif”.

How GIF works

  • At most 256 colours per frame. Each image uses a palette of up to 256 colours, either global or per frame. Photographs must be reduced to that palette, which causes banding or visible dither dots.
  • Lossless LZW compression of the palette indices. Lossless only applies to the palette: converting a photo to GIF is lossy because of the colour reduction.
  • Animation is a sequence of frames, each with a delay in hundredths of a second. Frames may cover only part of the canvas, which saves space when little changes. Browsers treat very short delays (0 or 0.01 s) as 0.1 s, so “fast” GIFs play slower than intended.
  • Transparency is on or off. One palette colour can be marked transparent, there is no partial transparency. Anti-aliased edges were blended into a specific background colour, which is why transparent GIFs get a light or dark fringe on another background.
  • No sound, no colour profile, no Exif. Only text comments and application blocks.

Opening and editing GIF

The simplest way to play an animated GIF on a computer is to drag it into a browser window. Image viewers on Windows, macOS (Preview shows the individual frames in the sidebar), Linux and phones open GIFs too. GIMP loads each frame as a layer and can export animation again, Photoshop has a timeline for it. The command-line tool gifsicle optimises, crops and slows down GIFs without recompressing everything.

Common GIF problems

GIF is too big to upload or send

A few seconds of video as GIF easily take 10 to 20 MB, because GIF has no motion compression. The same clip as MP4 is typically ten times smaller and looks better. Convert GIF to MP4 or WebP, or shorten it, crop it and reduce the frame rate.

GIF does not move

Some programs show only the first frame, for example older desktop versions of Outlook or document editors. In a presentation it usually plays only in slideshow mode. A loop count set to “once” in the file also stops the animation after the first run.

GIF looks grainy, colours are wrong

That is the 256-colour palette. For photos and gradients use PNG, WebP or video instead.

White or black edges around a transparent GIF

The edge pixels were blended with the background colour the author worked on. Re-export from the original as PNG, which has real alpha transparency.

Converting GIF

Our converter handles GIF in two ways. To still-image formats such as PNG, JPG or BMP it takes only the first frame. To formats that can hold several images it keeps all frames: WebP and APNG remain animated, while TIFF and PDF get one page per frame. GIF to MP4 and other video formats uses the H.264 codec; transparent areas do not survive, because MP4 has no alpha. In the other direction, video to GIF, we create at most 30 seconds at 10 frames per second and 480 pixels wide, with a palette computed from the clip, which keeps the file manageable. Static GIF graphics are best converted to PNG, losslessly and usually smaller.

GIF at a glance

Developed byCompuServe (Steve Wilhite)
First release1987 (87a), current version 89a from 1989
Typeraster image, animation
Compressionlossless LZW on palette indices
Coloursmax. 256 per frame, 1-bit transparency
Typical useshort animations, memes, simple web graphics

Sources: the GIF89a specification hosted by W3C and the Library of Congress format description.

We can convert GIF into

Documents

PDF TXTPDF/A

Images

JPG PNGWEBP TIFFHEICAVIFJXLPSDICOAAIAPNGARTAVS BMP CINCURDCMDCXDDSDPXFF FITSFL32 HDRHRZJP2JBIGJNGJPCMNGMTVOTBPALMPAM PBMPCD PCXPFMPGMPGXPHMPICTPPMPSBPTIFQOIRASRGFSGISIXELSUN TGAVICARVIFFVIPS WBMPXBMXPMXWD

Vector images

SVG EPSEMF PSFXGHPGLPOVSIFSVGZWMFXAML

Video

MP4AVIMKVMOVWEBM3G23GPAMVASFDVF4VFLVH264HEVCM2TSM4VMPGMXFNUTOGVRMSWFTSVOBWMVWTVY4M

Audio

MP3WAVFLACOGGM4AAIFFWMAAACAC3AUCAFDTSEAC3GSMM4BMKAMLPMMFMP2OGAOPUSRASPXTHDTTAVOCW64WV8SVXAIFCAVRCVSDATHCOMHTKMAUDSDSSFSLNSMPSNDRSNDTTXWVMSVOXWVE

eBooks

EPUB MOBI AZW3 FB2CBZDJVUHTMLZ LIT LRF OEB PDB TCRTXTZCB7CBT