Graphics Interchange Format (GIF) was introduced by the CompuServe online service in 1987, intended to provide a consistent and compact format for graphics to be downloaded on that service. Since the specifications were openly released, the format gained wide use in graphics software and on online services and bulletin board systems (BBSs), not just CompuServe; later it became a major Web graphic format. GIF's ability to have animation (unlike most still graphic formats) has caused it to gain some Internet notoriety and use in conjunction with "memes".

Patents

In 1994, it became widely known that the format was encumbered by the use of the patent-protected LZW compression technology, for which its owner, Unisys, was demanding licencing terms and royalties for certain sorts of uses. This made GIF a less-than-free format, spurring a desire on the part of some people for an unencumbered format, which led to the creation of the PNG format. However, it took several years for PNG to get widespread support in software, and in the meantime the World Wide Web experienced meteoric growth with GIF still used as the primary graphics format (alongside JPEG), though eventually PNG did become widespread on the Web as well. The patent in question expired in the US in 2003, and in other countries in 2004, so it is no longer an issue.

Another attempt at a patent-free format to replace GIF, Jeff's Image Format (JIF), never caught on.

Pronunciation

There is much debate over whether to pronounce "GIF" with a hard or a soft G. The creators of the format at CompuServe pronounced GIF as "jif" with a soft "G" /ˈdʒɪf/ as in "gin". Steve Wilhite, the engineering lead at CompuServe, said that the intended pronunciation deliberately echoes the American peanut butter brand, Jif, and CompuServe employees would often say "Choosy developers choose GIF", spoofing this brand's television commercials.[1] In addition, a sample GIF that was bundled with software released by CompuServe in 1989 contains metadata that includes the following line: "Oh, incidentally, it's pronounced 'JIF'". The original image and metadata can be viewed on a Unix-like operating system with the following command:

Both pronunciations are acceptable to the Oxford American Dictionaries, which named it the word of the year[2] in 2012, in its supposed usage as a verb (which they don't seem to actually use in a sentence anywhere in their announcement).

Some hard-G proponents say that the hard "g" is proper due to it standing for "graphics", which has a hard "g", but others cite the normal English pattern of pronouncing "g" soft when followed by an "i" (though, like most English spelling and pronunciation rules, it has exceptions like "gift").

In 2013, Wilhite again reaffirmed the soft-G pronunciation[3], but there are some that still refuse to accept it[4].

Animated GIF

Unlike most other graphic formats, GIF supports multiple-frame animated graphics in addition to single-image graphics. These animated GIFs are often used on web pages, sometimes for good reasons, sometimes as a poor man's video format, and all too often (especially during the early wave of Web popularity) to animate clip art and other images that would be better left motionless. In the 2010s, the use of animated GIFs for spreading Internet memes had a sudden and intense burst of popularity, and could sometimes be used in a very artistic manner.

The GIF features used for animation seem to have been intended for slideshows, and not for the type of animation they came to be used for. In fact, the specification clearly states that "[GIF] is not intended as a platform for animation." The only missing element – a loop count – was supplied by Netscape's looping extension (see below).

In the popular vernacular these days, "GIF" seems synonymous with "animated GIF", even though the format has a long history of use in static (non-animated) graphics. Much (though not all) use of static GIFs has shifted to PNG and other formats, leaving GIF in the niche of animated graphics.

In response to the popularity of animated GIFs, as well as the fact that this is actually not a very efficient format for storage and transmission of animations (each frame must be included as a complete image, without the economies of compression used in animation formats that store only the changes between one frame and the next), some social-networking and image-hosting services have begun converting animated GIFs uploaded by users to other formats for display. For instance, Imgur uses its own GIFV format, which is actually an MP4 video encapsulated as an element in an HTML 5 document, which is served with a .gifv extension. The result is that popular use of the term "GIF" now often refers to things that are not actually in that format; it seems to have taken on the meaning of "brief, small, silent animated sequence usually found on web pages or in social media feeds", without regard to their actual file format, so you have the peculiar situation where a static graphic in GIF format is not a "GIF" but a short, silent MP4 video is one. Language evolution is peculiar.

Color format

GIF images are always paletted. The number of colors in a palette can be any power of 2 from 2 to 256.

If a GIF file contains multiple images, each may have its own palette. This makes it possible for animated GIFs to construct frames that exceed the usual limit of 256 colors[5]. This technique is inefficient, and may result in very large files.

Format

A GIF file has a header (consisting of a signature, a screen descriptor, and optionally a global color table), followed by a sequence of tagged blocks of various types.

Block type 0x21 is an extension. Each extension has a byte indicating its type. GIF version 89a defines extension type 0xff to be an application extension, which can be used to store arbitrary data.

An application extension's specific type is given by an application identifier consisting of exactly 8 ASCII characters, plus a three-byte "authentication code" to reduce the chance of a conflict. In effect, this means it has an 11-byte identifier.

Known application extensions

"NETSCAPE" 0x32 0x2e 0x30 ("NETSCAPE2.0")

If the first byte of application data has value 0x01, this is a looping extension used in animated GIFs. It indicates the number of times to repeat the animation.

If the first byte is not 0x01, the extension is probably of no interest, but apparently at least one such extension was defined (0x02 = Netscape Buffering Extension[6]).

This web comic, part of a time-travel storyline, has a schoolgirl sleuth likening a time-looped version of 1960 at the other end of a wormhole to an animated GIF. (Not too much info about file formats here, but a neat comic!)