GIF

[3] CompuServe introduced GIF on 15 June 1987 to provide a color image format for their file downloading areas.

Since this was more efficient than the run-length encoding used by PCX and MacPaint, fairly large images could be downloaded reasonably quickly even with slow modems.

While GIF was developed by CompuServe, it used the Lempel–Ziv–Welch (LZW) lossless data compression algorithm patented by Unisys in 1985.

Controversy over the licensing agreement between Unisys and CompuServe in 1994 spurred the development of the Portable Network Graphics (PNG) standard.

The feature of storing multiple images in one file, accompanied by control data, is used extensively on the Web to produce simple animations.

The press's lexicographers voted it their word of the year, saying that GIFs have evolved into "a tool with serious applications including research and journalism".

The most common pronunciations in English are /dʒɪf/ ⓘ (with a soft g as in gin) and /ɡɪf/ ⓘ (with a hard g as in gift), differing in the phoneme represented by the letter G. The creators of the format pronounced the acronym GIF as /dʒɪf/, with a soft g, with Wilhite stating that he intended for the pronunciation to deliberately echo the American peanut butter brand Jif, and CompuServe employees would often quip "choosy developers choose GIF", a spoof of Jif's television commercials.

Smucker Company, the owners of the Jif brand, partnered with the animated image database and search engine Giphy to release a limited-edition "Jif vs. GIF" (hashtagged as #JIFvsGIF) jar of peanut butter that had a label humorously declaring the soft-g pronunciation to refer exclusively to the peanut butter, and GIF to be exclusively pronounced with the hard-g pronunciation.

This takes advantage of the format's lossless compression, which favors flat areas of uniform color with well defined edges.

[34] Conceptually, a GIF file describes a fixed-sized graphical area (the "logical screen") populated with zero or more "images".

[37][38][better source needed] Sample image (enlarged), actual size 3 pixels wide by 5 high The hex numbers in the following tables are in little-endian byte order, as the format specification prescribes.

The image pixel data, scanned horizontally from top left, are converted by LZW encoding to codes that are then mapped into bytes for storing in the file.

In practice the codes can be stored in order of numerical value; this allows each search to be done by a SAR (Successive Approximation Register, as used in some ADCs), with only 12 magnitude comparisons.

Although there would be no point in encoding the file that way, something similar typically happens for bi-color images: the minimum symbol width is 2, even if only values 0 and 1 are used.

Uncompressed GIF can also be a useful intermediate format for a graphics programmer because individual pixels are accessible for reading or painting.

To facilitate displaying animations, the GIF89a spec added the Graphic Control Extension (GCE), which allows the images (frames) in the file to be painted with time delays, forming a video clip.

The following example shows the structure of the animation file Rotating earth (large).gif shown (as a thumbnail) in the article's infobox.

The size and color quality of animated GIF files can vary significantly depending on the application used to create them.

More advanced techniques involve modifying color sequences to better match the existing LZW dictionary, a form of lossy compression.

Simply packing a series of independent frame images into a composite animation tends to yield large file sizes.

In 1977 and 1978, Jacob Ziv and Abraham Lempel published a pair of papers on a new class of lossless data-compression algorithms, now collectively referred to as LZ77 and LZ78.

[49] LZW became a popular data compression technique and, when the patent was granted, Unisys entered into licensing agreements with over a hundred companies.

[42] Unisys became aware that the version of GIF used the LZW compression technique and entered into licensing negotiations with CompuServe in January 1993.

[43] Unisys stated that they expected all major commercial on-line information services companies employing the LZW patent to license the technology from Unisys at a reasonable rate, but that they would not require licensing, or fees to be paid, for non-commercial, non-profit GIF-based applications, including those for use on the on-line services.

[50] Following this announcement, there was widespread condemnation of CompuServe and Unisys, and many software developers threatened to stop using GIF.

Nevertheless, Unisys was subjected to thousands of online attacks and abusive emails from users believing that they were going to be charged $5000 or sued for using GIFs on their websites.

[58] Portable Network Graphics (PNG) was designed as a replacement for GIF in order to avoid infringement of Unisys' patent on the LZW compression technique.

[62] Complete support for GIF is complicated chiefly by the complex canvas structure it allows, though this is what enables the compact animation features.

They include drastically smaller file sizes, the ability to surpass the 8-bit color restriction, and better frame-handling and compression through inter-frame coding.

In April 2014, 4chan added support for silent WebM videos that are under 3 MB in size and 2 min in length,[76][77] and in October 2014, Imgur started converting any GIF files uploaded to the site to H.264 video and giving the link to the HTML player the appearance of an actual file with a .gifv extension.

"Under construction" animated GIFs were a common feature of unfinished websites in the late 90s and early noughts.
Animated GIFs like this one were once a common decorative feature of personal websites in the late 90s and early noughts.
A humorous infographic announcing the 2013 launch of a Tumblr account for the White House suggests pronouncing GIF with a hard g .
An example of a GIF image saved with a web-safe palette and dithered using the Floyd–Steinberg method; as a consequence of the relatively few colors allowed in such an image, the image's contrast and colorfulness are noticeably poor.
An animated GIF illustrating a technique for displaying more than the typical limit of 256 colors
Bytes D h to 30C h in the example define a palette of 256 colors. The indexes used in the sample image for black and white are 28 h and FF h .
Screen capture of an interlaced GIF loading in a web browser
GIF can be used to display animation, as in this image of Newton's cradle .