GIF

From TheAlmightyGuru
Jump to: navigation, search
A still from a skit about the pronunciation of GIF, saved as a GIF.

Graphic Interchange Format, abbreviated to GIF and usually vocalized as "giff," though sometimes "jiff," is a raster graphic and animation format created by Steve Wilhite's team at CompuServe and released on 1987-06-15. The format was designed with slow networks in mind, so it has built-in compression, interlacing, and image compositing. It supports up to 8-bit color. In 1989, the format was updated to include transparency and additional animation features. These features, and CompuServe pushing the format, helped GIF became the primary choice of World Wide Web browser developers, and it quickly became the Web's de facto standard for raster images. However, lawsuits due to GIF using a patented compression algorithm complicated things for developers writing software to create GIFs. This, along with the stagnation of GIF features, led to the creation of an patent-free replacement called PNG which was published in 1996. By 2004, all of the contentious patents used in GIF had expired, but, by then, PNG had already gained such a foothold that it was supplanting GIF as the de facto standard. However, because PNG didn't support animation, animated GIFs continued to remain popular for many years later. Although Flash began to replace animated GIFs, it too dropped in popularity, and, today WEBP and WEBM have mostly supplanted animated GIFs.

GIF has little utility today. It was never useful for photographs, vector graphics, video, or printing, and, although it is still a passable format for screenshots and pixel art and animations of them, it has been surpassed in quality by a variety of newer formats which now have widespread support.

Personal

I remember seeing GIF images when I first started visiting BBSes in the late 1990s, and I made heavy use of them when I first started creating Web pages. However, in the early 2000s, when 24-bit color had become the norm, I became annoyed with the format's lack of 24-bit color support, and began migrating to PNG. Unfortunately, Internet Explorer, the dominant browser at the time, didn't support transparency in 24-bit color mode, so I still downgraded most of my PNG images to 8-bit color, but, the compression of PNG was superior to GIF, so it was still a win. I only continued to use GIF for animation, and, even then, I rarely used it. Now, I see GIF as a format that has long outlasted its utility.

Technical

Compression

GIF utilizes the Lempel–Ziv–Welch (LZW) lossless compression algorithm. This was a state-of-the-art compression algorithm at the time, making GIF files much smaller than competing formats like BMP or PCX which could use run-length encoding. Unfortunately, the compression format was also copyrighted, and this made it very expensive for software developers to add support for GIF creation to their graphic editors. The compression algorithm is now quite outdated and all modern graphic formats out-perform it.

Colors

GIF supports 1, 4, or 8 bit color depth (2, 16, or 256 colors) with palettes chosen from a 24-bit color space. It does not support higher bit-depths making it unsuitable for photographs and it does not support CYMK or any other color space, making it unsuitable for printing.

Transparency

GIF supports binary transparency, meaning a transparent pixel is either completely transparent or completely opaque. When transparency is used, one of the indexes in the color palette is designated for transparency rather than a color. Modern graphic formats typically support 256 levels of transparency.

Interlacing

In order to accommodate slow connections, GIF supports a simple form of interlacing. Instead of the rows of pixels being stored in a continuous steam, every 8th row is stored with the missing rows interpolated, then every 4th row, then every other row. As the remaining gaps are filled in, the image becomes clearer. This allows a user with a slow connection to see a blurry preview of the image which will often result in them being able to know if they have the correct image before it finishes loading. However, interlacing tends to negatively affect the compression algorithm typically resulting in slightly larger file sizes.

Compositing

In order to save space, GIF supports image compositing on a background. This means the format stores a background color for the entire image, then multiple images which can each be placed in different locations in the background. For images that feature a lot of single-color background space, like screenshots, this can save a lot of space. Unfortunately, very few editors support this feature and instead flatten the composites into a single stream of pixels before saving. Each composite can have independent palette, transparency, and interlacing settings.

Animation

GIF animation is pretty customizable. Each frame can be made up of multiple composites, each with their own palette. Also, every frame can have a unique time delay and instructions for handling the transition from the previous frame. GIF animation is useful for short clips, but, due to its low color count and inability to store audio, it is not a good replacement for video. Although GIF was successfully superseded by PNG, attempts to replace GIF animation with formats like MNG, APNG, and animated WEBP were made, but they none have really taken off, and, now that browsers support full video, they're unlikely to ever become very popular.

Software

Program Functions Notes
Corel Draw Open, Save Can import and export to GIF. Supports some features, no animation.
Corel Photo-Paint Open, Edit, Save Supports interlacing and transparency, but not 4-bit color. Supports some animation features.
GraphicsGale Open, Edit, Save Supports most features, including animation.
ImageMagick Open, Edit, Save Supports pretty much all features.
IrfanView Open Can view GIFs using pretty much all features.
LibreOffice Open, Save Can import and export to GIF. Supports some features, no animation.
Paint.net Open, Edit, Save Supports some features, no animation.

Media

Videos

Hello Generic - Pronunciation skit.

Links

Link-Wikipedia.png