GIF
The Graphics Interchange Format is a bitmap image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released on June 15, 1987.
The format can contain up to 8 bits per pixel, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space. It can also represent multiple images in a file, which can be used for animations, and allows a separate palette of up to 256 colors for each frame. These palette limitations make GIF less suitable for reproducing color photographs and other images with color gradients but well-suited for simpler images such as graphics or logos with solid areas of color.
GIF images are compressed using the Lempel–Ziv–Welch lossless data compression technique to reduce the file size without degrading the visual quality. While once in widespread usage on the World Wide Web because of its wide implementation and portability between applications and operating systems, usage of the format has declined for space and quality reasons, often being replaced with newer formats such as PNG for static images and MP4 for videos. In this context, short video clips are sometimes termed "GIFs" despite having no relation to the original file format.
History
introduced GIF on 15 June 1987 to provide a color image format for their file downloading areas. This replaced their earlier run-length encoding format, which was black and white only. GIF became popular because it used Lempel–Ziv–Welch data compression. 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.The original version of GIF was called 87a. This version already supported multiple images in a stream.
In 1989, CompuServe released an enhanced version, called 89a, This version added:
- support for animation delays
- transparent background colors
- storage of application-specific metadata
- allowing text labels as text. However, this feature is rarely used. Modern browsers do not support it, and there is little control over fonts and styling.
CompuServe encouraged the adoption of GIF by providing downloadable conversion utilities for many computers. By December 1987, for example, an Apple IIGS user could view pictures created on an Atari ST or Commodore 64. GIF was one of the first two image formats commonly used on Web sites, the other being the black-and-white XBM.
In September 1995 Netscape Navigator 2.0 added [|the ability for animated GIFs to loop].
While GIF was developed by CompuServe, it used the Lempel–Ziv–Welch 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 standard. In 2004, all patents relating to the proprietary compression used for GIF expired.
The feature of storing multiple images in one file, accompanied by control data, is used extensively on the Web to produce simple animations.
The optional interlacing feature, which stores image scan lines out of order in such a fashion that even a partially downloaded image was somewhat recognizable, also helped GIF's popularity, as a user could abort the download if it was not what was required.
In May 2015 Facebook added support for GIF. In 2014, Twitter, also added support to GIF as well as Instagram in 2018.
In 2016, the Internet Archive released a searchable library of GIFs from their GeoCities archive.
Terminology
As a noun, the word GIF is found in the newer editions of many dictionaries. In 2012, the American wing of the Oxford University Press recognized GIF as a verb as well, meaning "to create a GIF file", as in "GIFing was the perfect medium for sharing scenes from the Summer Olympics". 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".Pronunciation
The pronunciation of the first letter of GIF has been disputed since the 1990s. The most common pronunciations in English are and , differing in the phoneme represented by the letter G. The creators of the format pronounced the acronym GIF as, 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. However, the word is widely pronounced as, with a hard g, and polls have generally shown that this hard g pronunciation is more prevalent.Dictionary.com cites both pronunciations, indicating as the primary pronunciation, while Cambridge Dictionary of American English offers only the hard-g pronunciation. Merriam-Webster's Collegiate Dictionary and Oxford Dictionaries cite both pronunciations, but place the hard g first:. The New Oxford American Dictionary gave only in its second edition but updated it to in the third edition.
The disagreement over the pronunciation has led to heated Internet debate. On the occasion of receiving a lifetime achievement award at the 2013 Webby Awards ceremony, Wilhite publicly rejected the hard-g pronunciation; his speech led to more than 17,000 posts on Twitter and dozens of news articles. The White House and the TV program Jeopardy! also entered the debate in 2013. In February 2020, The J.M. 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" 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.
Usage
GIFs are suitable for sharp-edged line art with a limited number of colors, such as logos. This takes advantage of the format's lossless compression, which favors flat areas of uniform color with well defined edges. They can also be used to store low-color sprite data for games. GIFs can be used for small animations and low-resolution video clips, or as reactions in online messaging used to convey emotion and feelings instead of using words. They are popular on social media platforms such as Tumblr, Facebook and Twitter.File format
Conceptually, a GIF file describes a fixed-sized graphical area populated with zero or more "images". Many GIF files have a single image that fills the entire logical screen. Others divide the logical screen into separate sub-images. The images may also function as animation frames in an animated GIF file, but again these need not fill the entire logical screen.GIF files start with a fixed-length header giving the version, followed by a fixed-length Logical Screen Descriptor giving the pixel dimensions and other characteristics of the logical screen. The screen descriptor may also specify the presence and size of a Global Color Table, which follows next if present.
Thereafter, the file is divided into segments of the following types, each introduced by a 1-byte sentinel:
- An image
- An extension block
- The trailer, which should be the last byte of the file.
Extension blocks consist of the sentinel, an additional byte specifying the type of extension, and a series of sub-blocks with the extension data. Extension blocks that modify an image must immediately precede the segment with the image they refer to.
Each sub-block begins with a byte giving the number of subsequent data bytes in the sub-block. The series of sub-blocks is terminated by an empty sub-block.
This structure allows the file to be parsed even if not all parts are understood. A GIF marked 87a may contain extension blocks; the intent is that a decoder can read and display the file without the features covered in extensions it does not understand.
The full detail of the file format is covered in the GIF specification.
Palettes
GIF is a palette-based image format: each frame contains up to 256 colors chosen from the full 24-bit RGB color space. These colors are defined in a table, and each pixel refers to an index in this palette. Originally, this was appropriate for hardware with limited color support; today, it makes GIF ideal for simple graphics, line drawings, logos, and basic animations. To approximate more colors, dithering techniques are sometimes used, but these can reduce image clarity or increase file size.A GIF file may have a global color table, and each frame may also have a local color table. To conserve space, the specification allows color tables of 2n colors for any n from 1 through 8. Most graphics applications will read and display GIF images with any of these table sizes; but many do not support all sizes when creating images. Tables of 2, 16, and 256 colors are widely supported.
GIF supports transparency, allowing one color to be marked as transparent so that backgrounds or layered effects can show through.
True color
Although GIF is almost never used for true color images, it is possible to do so. A GIF image can include multiple image blocks, each of which can have its own 256-color palette, and the blocks can be tiled to create a complete image. Alternatively, the GIF89a specification introduced the idea of a "transparent" color where each image block can include its own palette of 255 visible colors plus one transparent color. A complete image can be created by layering image blocks with the visible portion of each layer showing through the transparent portions of the layers above.To render a full-color image as a GIF, the original image must be broken down into smaller regions having no more than 255 or 256 different colors. Each of these regions is then stored as a separate image block with its own local palette and when the image blocks are displayed together, the complete, full-color image appears. For example, breaking an image into tiles of 16 by 16 pixels ensures that no tile has more than the local palette limit of 256 colors, although larger tiles may be used and similar colors merged resulting in some loss of color information.
Since each image block can have its own local color table, a GIF file having many image blocks can be very large, limiting the usefulness of full-color GIFs. Additionally, not all GIF rendering programs handle tiled or layered images correctly. Many rendering programs interpret tiles or layers as animation frames and display them in sequence as an animation with most web browsers automatically displaying the frames with a delay time of 0.1 seconds or more.