Blinky (image)
   HOME

TheInfoList



OR:

The Graphics Interchange Format (GIF; or , ) is a
bitmap In computing, a bitmap (also called raster) graphic is an image formed from rows of different colored pixels. A GIF is an example of a graphics image file that uses a bitmap. As a noun, the term "bitmap" is very often used to refer to a partic ...
image format An image or picture is a visual representation. An image can be two-dimensional, such as a drawing, painting, or photograph, or three-dimensional, such as a carving or sculpture. Images may be displayed through other media, including a ...
that was developed by a team at the online services provider
CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
led by American computer scientist
Steve Wilhite Stephen Earl Wilhite (March 3, 1948 – March 14, 2022) was an American computer scientist who worked at CompuServe and was the engineering lead on the team that created the GIF image file format in 1987. GIF went on to become the de facto sta ...
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 Notable 24-bit machines include the CDC 924 – a 24-bit version of the CDC 1604, CDC lower 3000 series, SDS 930 and SDS 940, the ICT 1900 series, the Elliott 4100 series, and the Datacraft minicomputers/ Harris H series. The term SWORD ...
RGB color space RGB color spaces are a category of additive colorimetric color spaces specifying part of its absolute color space definition using the RGB color model. RGB color spaces are commonly found describing the mapping of the RGB color model to human p ...
. It can also represent multiple images in a file, which can be used for
animation Animation is a filmmaking technique whereby still images are manipulated to create moving images. In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film. Animati ...
s, 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 Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lem ...
(LZW)
lossless data compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits Redundanc ...
technique to reduce the file size without degrading the visual quality. While once in widespread usage on the
World Wide Web The World Wide Web (WWW or simply the Web) is an information system that enables Content (media), content sharing over the Internet through user-friendly ways meant to appeal to users beyond Information technology, IT specialists and hobbyis ...
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 Portable Network Graphics (PNG, officially pronounced , colloquially pronounced ) is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange ...
for static images and
MP4 MP4 (formally MPEG-4 Part 14), is a digital multimedia container format most commonly used to store video and audio, but it can also be used to store other data such as subtitles and still images. Like most modern container formats, it allows ...
for videos. In this context, short video clips are sometimes termed "GIFs" despite having no relation to the original file format.


History

CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
introduced GIF on 15 June 1987 to provide a color image format for their file downloading areas. This replaced their earlier
run-length encoding Run-length encoding (RLE) is a form of lossless data compression in which ''runs'' of data (consecutive occurrences of the same data value) are stored as a single occurrence of that data value and a count of its consecutive occurrences, rather th ...
format, which was black and white only. GIF became popular because it used
Lempel–Ziv–Welch Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lem ...
data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compressi ...
. Since this was more efficient than the run-length encoding used by PCX and
MacPaint MacPaint is a raster graphics editor developed by Apple Computer and released alongside the original Macintosh personal computer on January 24, 1984. It was sold bundled with its word processing counterpart, MacWrite, for US$195. MacPaint was n ...
, fairly large images could be downloaded reasonably quickly even with slow
modem The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
s. 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 (not embedding them in the graphical data). However, this feature is rarely used. Modern browsers do not support it, and there is little control over fonts and styling. The two versions can be distinguished by looking at the first six
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
s of the file (the " magic number" or signature), which, when interpreted as
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
, read "GIF87a" or "GIF89a", respectively. CompuServe encouraged the adoption of GIF by providing downloadable conversion utilities for many computers. By December 1987, for example, an
Apple IIGS The Apple IIGS (styled as II) is a 16-bit personal computer produced by Apple Inc., Apple Computer beginning in September 1986. It is the fifth and most powerful model of the Apple II family. The "GS" in the name stands for "Graphics and Sound" ...
user could view pictures created on an
Atari ST Atari ST is a line of personal computers from Atari Corporation and the successor to the company's Atari 8-bit computers, 8-bit computers. The initial model, the Atari 520ST, had limited release in April–June 1985, and was widely available i ...
or
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
. GIF was one of the first two image formats commonly used on Web sites, the other being the black-and-white
XBM In computer graphics, the X Window System used X BitMap (XBM), a plain text binary image format, for storing cursor and icon bitmaps used in the X GUI. The XBM format is superseded by XPM, which first appeared for X11 in 1989. Format XBM files ...
. In September 1995
Netscape Navigator The 1990s releases of the Netscape (web browser), Netscape line referred to as Netscape Navigator were a series of now discontinued web browsers. from versions 1 to 4.08. It was the Core product, flagship product of the Netscape, Netscape Comm ...
2.0 added the ability for animated GIFs to loop. While GIF was developed by
CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
, it used the
Lempel–Ziv–Welch Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lem ...
(LZW)
lossless data compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits Redundanc ...
algorithm patented by
Unisys Unisys Corporation is a global technology solutions company founded in 1986 and headquartered in Blue Bell, Pennsylvania. The company provides cloud, AI, digital workplace, logistics, and enterprise computing services. History Founding Unis ...
in 1985. Controversy over the licensing agreement between
Unisys Unisys Corporation is a global technology solutions company founded in 1986 and headquartered in Blue Bell, Pennsylvania. The company provides cloud, AI, digital workplace, logistics, and enterprise computing services. History Founding Unis ...
and
CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
in 1994 spurred the development of the
Portable Network Graphics Portable Network Graphics (PNG, officially pronounced , colloquially pronounced ) is a raster graphics, raster-graphics file graphics file format, format that supports lossless data compression. PNG was developed as an improved, non-patented ...
(PNG) 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 Animation is a filmmaking technique whereby still images are manipulated to create moving images. In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film. Animati ...
. 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 Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
added support for GIF. In 2014,
Twitter Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
, also added support to GIF as well as
Instagram Instagram is an American photo sharing, photo and Short-form content, short-form video sharing social networking service owned by Meta Platforms. It allows users to upload media that can be edited with Social media camera filter, filters, be ...
in 2018. In 2016, the Internet Archive released a searchable library of GIFs from their
Geocities GeoCities, later Yahoo! GeoCities, was a web hosting service that allowed users to create and publish websites for free and to browse user-created websites by their theme or interest, active from 1994 to 2009. GeoCities was started in November 1 ...
archive.


Terminology

As a
noun In grammar, a noun is a word that represents a concrete or abstract thing, like living creatures, places, actions, qualities, states of existence, and ideas. A noun may serve as an Object (grammar), object or Subject (grammar), subject within a p ...
, the word ''GIF'' is found in the newer editions of many dictionaries. In 2012, the American wing of the
Oxford University Press Oxford University Press (OUP) is the publishing house of the University of Oxford. It is the largest university press in the world. Its first book was printed in Oxford in 1478, with the Press officially granted the legal right to print books ...
recognized ''GIF'' as a
verb A verb is a word that generally conveys an action (''bring'', ''read'', ''walk'', ''run'', ''learn''), an occurrence (''happen'', ''become''), or a state of being (''be'', ''exist'', ''stand''). In the usual description of English, the basic f ...
as well, meaning "to create a GIF file", as in "GIFing was the perfect medium for sharing scenes from the
Summer Olympics The Summer Olympic Games, also known as the Summer Olympics or the Games of the Olympiad, is a major international multi-sport event normally held once every four years. The inaugural Games took place in 1896 in Athens, then part of the King ...
". 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 (with a soft ''g'' as in ''gin'') and (with a hard ''g'' as in ''gift''), differing in the
phoneme A phoneme () is any set of similar Phone (phonetics), speech sounds that are perceptually regarded by the speakers of a language as a single basic sound—a smallest possible Phonetics, phonetic unit—that helps distinguish one word fr ...
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 Peanut butter is a food Paste (food), paste or Spread (food), spread made from Grinding (abrasive cutting), ground, dry roasting, dry-roasted peanuts. It commonly contains additional ingredients that modify the taste or texture, such as salt, ...
brand Jif, and
CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
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 ''Dictionary.com'' is an online dictionary whose domain was first registered on May 14, 1995. The primary content on ''Dictionary.com'' is a proprietary dictionary based on '' Random House Unabridged Dictionary'', with editors for the site prov ...
'' 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 ''Webster's Dictionary'' is any of the US English language dictionaries edited in the early 19th century by Noah Webster (1758–1843), a US lexicographer, as well as numerous related or unrelated dictionaries that have adopted the Webster's ...
'' and Oxford Dictionaries cite both pronunciations, but place the hard ''g'' first: . The ''
New Oxford American Dictionary The ''New Oxford American Dictionary'' (''NOAD'') is a single-volume dictionary of American English compiled by American editors at the Oxford University Press. ''NOAD'' is based upon the '' New Oxford Dictionary of English'' (''NODE''), publishe ...
'' 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 The 17th annual Webby Awards for 2013 was held at the Hammerstein Ballroom in New York City on May 22, 2013, hosted by comedian Patton Oswalt.Coyle, Jake.Webby Awards Winners Include 'House Of Cards,' Frank Ocean. ''The Huffington Post''. 30 Apri ...
ceremony, Wilhite publicly rejected the hard-''g'' pronunciation; his speech led to more than 17,000 posts on
Twitter Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
and dozens of news articles. The
White House The White House is the official residence and workplace of the president of the United States. Located at 1600 Pennsylvania Avenue Northwest (Washington, D.C.), NW in Washington, D.C., it has served as the residence of every U.S. president ...
and the TV program ''
Jeopardy! ''Jeopardy!'' is an American television game show created by Merv Griffin. The show is a quiz competition that reverses the traditional question-and-answer format of many quiz shows. Rather than being given questions, contestants are instead g ...
'' also entered the debate in 2013. In February 2020,
The J.M. Smucker Company The J.M. Smucker Company, also known as Smuckers, is an American manufacturer of food and beverage products. Headquartered in Orrville, Ohio, the company was founded in 1897 as a maker of apple butter. J.M. Smucker currently has three major b ...
, the owners of the Jif brand, partnered with the animated image database and search engine
Giphy Giphy (, ), styled as GIPHY, is an American online database and search engine that allows users to search for and share animated GIF files. History Beginnings and early history Giphy was founded by Alex Chung and Jace Cooke in February 2013.Al ...
to release a limited-edition "Jif vs. GIF" (
hashtag A hashtag is a metadata tag operator that is prefaced by the hash symbol, ''#''. On social media, hashtags are used on microblogging and photo-sharing services–especially Twitter and Tumblr–as a form of user-generated tagging that enable ...
ged 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.


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 Tumblr (pronounced "tumbler") is a microblogging and Social networking service, social networking website founded by David Karp in 2007 and is owned by American company Automattic. The service allows users to post multimedia and other content ...
,
Facebook Facebook is a social media and social networking service owned by the American technology conglomerate Meta Platforms, Meta. Created in 2004 by Mark Zuckerberg with four other Harvard College students and roommates, Eduardo Saverin, Andre ...
and
Twitter Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
.


File format

Conceptually, a GIF file describes a fixed-sized graphical area (the "logical screen") 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 ("GIF87a" or "GIF89a") giving the version, followed by a fixed-length
Logical Screen Descriptor Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the study of deductively valid inferences or logical truths. It examines how conclusions follow from premises based on the structure of argu ...
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 Global may refer to: General *Globe, a spherical model of celestial bodies *Earth, the third planet from the Sun Entertainment * ''Global'' (Paul van Dyk album), 2003 * ''Global'' (Bunji Garlin album), 2007 * ''Global'' (Humanoid album), 198 ...
(GCT), 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 (introduced by 0x2C, an ASCII comma ) * An extension block (introduced by 0x21, an ASCII exclamation point ) * The trailer (a single byte of value 0x3B, an ASCII semicolon ), which should be the last byte of the file. An image starts with a fixed-length
Image Descriptor An image or picture is a visual representation. An image can be two-dimensional, such as a drawing, painting, or photograph, or three-dimensional, such as a carving or sculpture. Images may be displayed through other media, including a project ...
, which may specify the presence and size of a
Local Color Table Local may refer to: Geography and transportation * Local (train), a train serving local traffic demand * Local, Missouri, a community in the United States Arts, entertainment, and media * ''Local'' (comics), a limited series comic book by Bria ...
(which follows next if present). The image data follows: one byte giving the bit width of the unencoded symbols (which must be at least 2 bits wide, even for bi-color images), followed by a series of sub-blocks containing the LZW-encoded data. Extension blocks (blocks that "extend" the 87a definition via a mechanism already defined in the 87a spec) 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 (like the Graphic Control Extension that specifies the optional animation delay time and optional transparent background color) 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 (1 to 255). The series of sub-blocks is terminated by an empty sub-block (a 0 byte). 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 palette-based: the colors used in an image (a frame) in the file have their
RGB The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three ...
values defined in a palette table that can hold up to 256 entries, and the data for the image refer to the colors by their indices (0–255) in the palette table. The color definitions in the palette can be drawn from a color space of millions of shades (224 shades, 8 bits for each primary), but the maximum number of colors a frame can use is 256. This limitation was reasonable when GIF was developed because hardware that could display more than 256 colors simultaneously was rare. Simple graphics, line drawings, cartoons, and grey-scale photographs typically need fewer than 256 colors. Each frame can designate one index as a "transparent background color": any pixel assigned this index takes on the color of the pixel in the same position from the background, which may have been determined by a previous frame of animation. Many techniques, collectively called
dither Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is ofte ...
ing, have been developed to approximate a wider range of colors with a small color palette by using pixels of two or more colors to approximate in-between colors. These techniques sacrifice spatial resolution to approximate deeper color resolution. While not part of the GIF specification, dithering can be used in images subsequently encoded as GIF images. This is often not an ideal solution for GIF images, both because the loss of spatial resolution typically makes an image look fuzzy on the screen, and because the dithering patterns often interfere with the compressibility of the image data, working against GIF's main purpose. In the early days of graphical web browsers, graphics cards with 8-bit buffers (allowing only 256 colors) were common and it was fairly common to make GIF images using the websafe palette. This ensured predictable display, but severely limited the choice of colors. When 24-bit color became the norm, palettes could instead be populated with the optimum colors for individual images. A small color table may suffice for small images, and keeping the color table small allows the file to be downloaded faster. Both the 87a and 89a specifications allow color tables of 2''n'' colors for any ''n'' from 1 through 8. Most graphics applications will read and display GIF images with any of these table sizes; but some do not support all sizes when ''creating'' images. Tables of 2, 16, and 256 colors are widely supported.


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 (either by tiling or by layering partially transparent image blocks), the complete, full-color image appears. For example, breaking an image into tiles of 16 by 16 pixels (256 pixels in total) 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.


Example GIF file

The hex numbers in the following tables are in
little-endian '' Jonathan_Swift.html" ;"title="Gulliver's Travels'' by Jonathan Swift">Gulliver's Travels'' by Jonathan Swift, the novel from which the term was coined In computing, endianness is the order in which bytes within a word (data type), word of d ...
byte order, as the format specification prescribes.


Image coding

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. The pixel codes typically don't match the 8-bit size of the bytes, so the codes are packed into bytes by a "little-Endian" scheme: the least significant bit of the first code is stored in the least significant bit of the first byte, higher order bits of the code into higher order bits of the byte, spilling over into the low order bits of the next byte as necessary. Each subsequent code is stored starting at the least significant bit not already used. This byte stream is stored in the file as a series of "sub-blocks". Each sub-block has a maximum length 255 bytes and is prefixed with a byte indicating the number of data bytes in the sub-block. The series of sub-blocks is terminated by an empty sub-block (a single 0 byte, indicating a sub-block with 0 data bytes). For the sample image above the reversible mapping between 9-bit codes and bytes is shown below. A slight compression is evident: pixel colors defined initially by 15 bytes are exactly represented by 12 code bytes including control codes. The encoding process that produces the 9-bit codes is shown below. A local string accumulates pixel color numbers from the palette, with no output action as long as the local string can be found in a code table. There is special treatment of the first two pixels that arrive before the table grows from its initial size by additions of strings. After each output code, the local string is initialized to the latest pixel color (that could not be included in the output code). Table 9-bit string --> code code Action #0 , 000h Initialize root table of 9-bit codes palette , : colors , : #255 , 0FFh clr , 100h end , 101h , 100h Clear Pixel Local , color Palette string , BLACK #40 28 , 028h 1st pixel always to output WHITE #255 FF , String found in table 28 FF , 102h Always add 1st string to table FF , Initialize local string WHITE #255 FF FF , String not found in table , 0FFh - output code for previous string FF FF , 103h - add latest string to table FF , - initialize local string WHITE #255 FF FF , String found in table BLACK #40 FF FF 28 , String not found in table , 103h - output code for previous string FF FF 28 , 104h - add latest string to table 28 , - initialize local string WHITE #255 28 FF , String found in table WHITE #255 28 FF FF , String not found in table , 102h - output code for previous string 28 FF FF , 105h - add latest string to table FF , - initialize local string WHITE #255 FF FF , String found in table WHITE #255 FF FF FF , String not found in table , 103h - output code for previous string FF FF FF , 106h - add latest string to table FF , - initialize local string WHITE #255 FF FF , String found in table WHITE #255 FF FF FF , String found in table WHITE #255 FF FF FF FF , String not found in table , 106h - output code for previous string FF FF FF FF, 107h - add latest string to table FF , - initialize local string WHITE #255 FF FF , String found in table WHITE #255 FF FF FF , String found in table WHITE #255 FF FF FF FF , String found in table No more pixels 107h - output code for last string 101h End For clarity the table is shown above as being built of strings of increasing length. That scheme can function but the table consumes an unpredictable amount of memory. Memory can be saved in practice by noting that each new string to be stored consists of a previously stored string augmented by one character. It is economical to store at each address only two words: an existing address and one character. The LZW algorithm requires a search of the table for each pixel. A linear search through up to 4096 addresses would make the coding slow. 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. For this efficiency an extra table is needed to convert between codes and actual memory addresses; the extra table upkeeping is needed only when a new code is stored which happens at much less than pixel rate.


Image decoding

Decoding begins by mapping the stored bytes back to 9-bit codes. These are decoded to recover the pixel colors as shown below. A table identical to the one used in the encoder is built by adding strings by this rule: shift 9-bit ----> Local Table Pixel code code code --> string Palette color Action 100h 000h , #0 Initialize root table of 9-bit codes : , palette : , colors 0FFh , #255 100h , clr 101h , end 028h , #40 Decode 1st pixel 0FFh 028h , Incoming code found in table , #255 - output string from table 102h , 28 FF - add to table 103h 0FFh , Incoming code not found in table 103h , FF FF - add to table , - output string from table , #255 , #255 102h 103h , Incoming code found in table , - output string from table , #40 , #255 104h , FF FF 28 - add to table 103h 102h , Incoming code found in table , - output string from table , #255 , #255 105h , 28 FF FF - add to table 106h 103h , Incoming code not found in table 106h , FF FF FF - add to table , - output string from table , #255 , #255 , #255 107h 106h , Incoming code not found in table 107h , FF FF FF FF - add to table , - output string from table , #255 , #255 , #255 , #255 101h , End


LZW code lengths

Shorter code lengths can be used for palettes smaller than the 256 colors in the example. If the palette is only 64 colors (so color indexes are 6 bits wide), the symbols can range from 0 to 63, and the symbol width can be taken to be 6 bits, with codes starting at 7 bits. In fact, the symbol width need not match the palette size: as long as the values decoded are always less than the number of colors in the palette, the symbols can be any width from 2 to 8, and the palette size any power of 2 from 2 to 256. For example, if only the first four colors (values 0 to 3) of the palette are used, the symbols can be taken to be 2 bits wide with codes starting at 3 bits. Conversely, the symbol width could be set at 8, even if only values 0 and 1 are used; these data would only require a two-color table. 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. The code table initially contains codes that are one bit longer than the symbol size in order to accommodate the two special codes ''clr'' and ''end'' and codes for strings that are added during the process. When the table is full the code length increases to give space for more strings, up to a maximum code 4095 = FFF(hex). As the decoder builds its table it tracks these increases in code length and it is able to unpack incoming bytes accordingly.


Uncompressed GIF

The GIF encoding process can be modified to create a file without LZW compression that is still viewable as a GIF image. This technique was introduced originally as a way to avoid patent infringement. Uncompressed GIF can also be a useful intermediate format for a graphics programmer because individual pixels are accessible for reading or painting. An uncompressed GIF file can be converted to an ordinary GIF file simply by passing it through an image editor. The modified encoding method ignores building the LZW table and emits only the root palette codes and the codes for CLEAR and STOP. This yields a simpler encoding (a 1-to-1 correspondence between code values and palette codes) but sacrifices all of the compression: each pixel in the image generates an output code indicating its color index. When processing an uncompressed GIF, a standard GIF decoder will not be prevented from writing strings to its dictionary table, but the code width must never increase since that triggers a different packing of bits to bytes. If the symbol width is , the codes of width fall naturally into two blocks: the lower block of codes for coding single symbols, and the upper block of codes that will be used by the decoder for sequences of length greater than one. Of that upper block, the first two codes are already taken: for CLEAR and for STOP. The decoder must also be prevented from using the last code in the upper block, , because when the decoder fills that slot, it will increase the code width. Thus in the upper block there are codes available to the decoder that won't trigger an increase in code width. Because the decoder is always one step behind in maintaining the table, it does not generate a table entry upon receiving the first code from the encoder, but will generate one for each succeeding code. Thus the encoder can generate codes without triggering an increase in code width. Therefore, the encoder must emit extra CLEAR codes at intervals of codes or less to make the decoder reset the coding dictionary. The GIF standard allows such extra CLEAR codes to be inserted in the image data at any time. The composite data stream is partitioned into sub-blocks that each carry from 1 to 255 bytes. For the sample 3×5 image above, the following 9-bit codes represent "clear" (100) followed by image pixels in scan order and "stop" (101). 100 028 0FF 0FF 0FF 028 0FF 0FF 0FF 0FF 0FF 0FF 0FF 0FF 0FF 0FF 101 After the above codes are mapped to bytes, the uncompressed file differs from the compressed file thus:


Compression example

The trivial example of a large image of solid color demonstrates the variable-length LZW compression used in GIF files. The code values shown are packed into bytes which are then packed into blocks of up to 255 bytes. A block of image data begins with a byte that declares the number of bytes to follow. The last block of data for an image is marked by a zero block-length byte.


Interlacing

The GIF Specification allows each image within the logical screen of a GIF file to specify that it is interlaced; i.e., that the order of the raster lines in its data block is not sequential. This allows a partial display of the image that can be recognized before the full image is painted. An interlaced image is divided from top to bottom into strips 8 pixels high, and the rows of the image are presented in the following order: * Pass 1: Line 0 (the top-most line) from each strip. * Pass 2: Line 4 from each strip. * Pass 3: Lines 2 and 6 from each strip. * Pass 4: Lines 1, 3, 5, and 7 from each strip. The pixels within each line are not interlaced, but presented consecutively from left to right. As with non-interlaced images, there is no break between the data for one line and the data for the next. The indicator that an image is interlaced is a bit set in the corresponding Image Descriptor block.


Animated GIF

Although GIF was not designed as an animation medium, its ability to store multiple images in one file naturally suggested using the format to store the frames of an animation sequence. 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 Video clip may refer to: *Short videos, especially short-form content ** Video clip (online media), a short snippet of a video uploaded on the internet *A music video A music video is a video that integrates a song or an album with imagery that ...
. Each frame in an animation GIF is introduced by its own GCE specifying the time delay to wait after the frame is drawn. Global information at the start of the file applies by default to all frames. The data is stream-oriented, so the file offset of the start of each GCE depends on the length of preceding data. Within each frame the LZW-coded image data is arranged in sub-blocks of up to 255 bytes; the size of each sub-block is declared by the byte that precedes it. By default, an animation displays the sequence of frames only once, stopping when the last frame is displayed. To enable an animation to loop,
Netscape Netscape Communications Corporation (originally Mosaic Communications Corporation) was an American independent computer services company with headquarters in Mountain View, California, and then Dulles, Virginia. Its Netscape web browser was o ...
in the 1990s used the Application Extension block (intended to allow vendors to add application-specific information to the GIF file) to implement the Netscape Application Block (NAB). This block, placed immediately before the sequence of animation frames, specifies the number of times the sequence of frames should be played (1 to 65535 times) or that it should repeat continuously (zero indicates loop forever). Support for these repeating animations first appeared in
Netscape Navigator The 1990s releases of the Netscape (web browser), Netscape line referred to as Netscape Navigator were a series of now discontinued web browsers. from versions 1 to 4.08. It was the Core product, flagship product of the Netscape, Netscape Comm ...
version 2.0, and then spread to other browsers. Most browsers now recognize and support NAB, though it is not strictly part of the GIF89a specification. The following example shows the structure of the animation file '' Rotating earth (large).gif'' shown (as a thumbnail) in the article's infobox. The animation delay for each frame is specified in the GCE in hundredths of a second. Some economy of data is possible where a frame need only rewrite a portion of the pixels of the display, because the Image Descriptor can define a smaller rectangle to be rescanned instead of the whole image. Browsers or other displays that do not support animated GIFs typically show only the first frame. The size and color quality of animated GIF files can vary significantly depending on the application used to create them. Strategies for minimizing file size include using a common global color table for all frames (rather than a complete local color table for each frame) and minimizing the number of pixels covered in successive frames (so that only the pixels that change from one frame to the next are included in the latter frame). More advanced techniques involve modifying color sequences to better match the existing LZW dictionary, a form of
lossy compression In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
. Simply packing a series of independent frame images into a composite animation tends to yield large file sizes. Tools are available to minimize the file size given an existing GIF.


Metadata

Metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
can be stored in GIF files as a comment block, a plain text block, or an application-specific application extension block. Several graphics editors use unofficial application extension blocks to include the data used to generate the image, so that it can be recovered for further editing. All of these methods technically require the metadata to be broken into sub-blocks so that applications can navigate the metadata block without knowing its internal structure. The
Extensible Metadata Platform The Extensible Metadata Platform (XMP) is an ISO standard, originally created by Adobe Systems Inc., for the creation, processing and interchange of standardized and custom metadata for digital documents and data sets. XMP standardizes a data ...
(XMP) metadata standard introduced an unofficial but now widespread "XMP Data" application extension block for including XMP data in GIF files. Since the XMP data is encoded using
UTF-8 UTF-8 is a character encoding standard used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode Transformation Format 8-bit''. Almost every webpage is transmitted as UTF-8. UTF-8 supports all 1,112,0 ...
without NUL characters, there are no 0 bytes in the data. Rather than break the data into formal sub-blocks, the extension block terminates with a "magic trailer" that routes any application treating the data as sub-blocks to a final 0 byte that terminates the sub-block chain.


Unisys and LZW patent enforcement

In 1977 and 1978,
Jacob Ziv Jacob Ziv (; 27 November 1931 – 25 March 2023) was an Israeli electrical engineer and information theorist who developed the LZ family of lossless data compression algorithms alongside Abraham Lempel. He is also a namesake of the Ziv–Zakai ...
and
Abraham Lempel Abraham Lempel (; 10 February 1936 – 4 February 2023) was an Israeli computer scientist and one of the fathers of the LZ family of lossless data compression algorithms. Biography Lempel was born on 10 February 1936 in Lwów, Poland (now Lviv ...
published a pair of papers on a new class of lossless data-compression algorithms, now collectively referred to as
LZ77 and LZ78 LZ77 and LZ78 are the two lossless data compression algorithms published in papers by Abraham Lempel and Jacob Ziv in 1977 and 1978. They are also known as Lempel-Ziv 1 (LZ1) and Lempel-Ziv 2 (LZ2) respectively. These two algorithms form the bas ...
. In 1983,
Terry Welch Terry Archer Welch (January 20, 1939 – November 22, 1988) was an American computer scientist. Along with Abraham Lempel and Jacob Ziv, he developed the lossless Lempel–Ziv–Welch (LZW) compression algorithm, which was published in 1984. Bi ...
developed a fast variant of LZ78 which was named
Lempel–Ziv–Welch Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lem ...
(LZW). Welch filed a patent application for the LZW method in June 1983. The resulting patent, US4558302, granted in December 1985, was assigned to
Sperry Corporation Sperry Corporation was a major American equipment and electronics company whose existence spanned more than seven decades of the 20th century. Sperry ceased to exist in 1986 following a prolonged hostile takeover bid engineered by Burroughs ...
who subsequently merged with
Burroughs Corporation The Burroughs Corporation was a major American manufacturer of business equipment. The company was founded in 1886 as the American Arithmometer Company by William Seward Burroughs I, William Seward Burroughs. The company's history paralleled many ...
in 1986 and formed
Unisys Unisys Corporation is a global technology solutions company founded in 1986 and headquartered in Blue Bell, Pennsylvania. The company provides cloud, AI, digital workplace, logistics, and enterprise computing services. History Founding Unis ...
. Further patents were obtained in the United Kingdom, France, Germany, Italy, Japan and Canada. In addition to the above patents, Welch's 1983 patent also includes citations to several other patents that influenced it, including: * two 1980 Japanese patents from
NEC is a Japanese multinational information technology and electronics corporation, headquartered at the NEC Supertower in Minato, Tokyo, Japan. It provides IT and network solutions, including cloud computing, artificial intelligence (AI), Inte ...
's Jun Kanatsu, * (1974) from John S. Hoerning, * (1977) from Klaus E. Holtz, and * a 1981 German patent from Karl Eckhart Heinz. In June 1984, an article by Welch was published in the
IEEE The Institute of Electrical and Electronics Engineers (IEEE) is an American 501(c)(3) organization, 501(c)(3) public charity professional organization for electrical engineering, electronics engineering, and other related disciplines. The IEEE ...
magazine which publicly described the LZW technique for the first time. LZW became a popular data compression technique and, when the patent was granted, Unisys entered into licensing agreements with over a hundred companies. – archived by
League for Programming Freedom League for Programming Freedom (LPF) was founded in 1989 by Richard Stallman to unite free software developers as well as developers of proprietary software to fight against software patents and the extension of the scope of copyright. Their logo ...
The popularity of LZW led
CompuServe CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
to choose it as the compression technique for their version of GIF, developed in 1987. At the time, CompuServe was not aware of the patent. Unisys became aware that the version of GIF used the LZW compression technique and entered into licensing negotiations with CompuServe in January 1993. The subsequent agreement was announced on 24 December 1994. 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. Following this announcement, there was widespread condemnation of CompuServe and Unisys, and many software developers threatened to stop using GIF. The PNG format (see below) was developed in 1995 as an intended replacement. However, obtaining support from the makers of Web browsers and other software for the PNG format proved difficult and it was not possible to replace GIF, although PNG has gradually increased in popularity. Therefore, GIF variations without LZW compression were developed. For instance the libungif library, based on
Eric S. Raymond Eric Steven Raymond (born December 4, 1957), often referred to as ESR, is an American software developer, open-source software advocate, and author of the 1997 essay and 1999 book ''The Cathedral and the Bazaar''. He wrote a guidebook for the R ...
's giflib, allows creation of GIFs that followed the data format but avoided the compression features, thus avoiding use of the Unisys LZW patent. A 2001 '' Dr. Dobb's'' article described a way to achieve LZW-compatible encoding without infringing on its patents. In August 1999, Unisys changed the details of their licensing practice, announcing the option for owners of certain non-commercial and private websites to obtain licenses on payment of a one-time license fee of $5000 or $7500. – clarification of 2 September 1999 Such licenses were not required for website owners or other GIF users who had used licensed software to generate GIFs. 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.Unisys Not Suing (most) Webmasters for Using GIFs
Slashdot ''Slashdot'' (sometimes abbreviated as ''/.'') is a social news website that originally billed itself as "News for Nerds. Stuff that Matters". It features news stories on science, technology, and politics that are submitted and evaluated by site ...
investigation into the controversy
Despite giving free licenses to hundreds of non-profit organizations, schools and governments, Unisys was completely unable to generate any good publicity and continued to be condemned by individuals and organizations such as the
League for Programming Freedom League for Programming Freedom (LPF) was founded in 1989 by Richard Stallman to unite free software developers as well as developers of proprietary software to fight against software patents and the extension of the scope of copyright. Their logo ...
who started the "Burn All GIFs" campaign in 1999.Burn All GIFs
– A project of the League for Programming Freedom (latest version)
The United States LZW patent expired on 20 June 2003. The counterpart patents in the United Kingdom, France, Germany and Italy expired on 18 June 2004, the Japanese patents expired on 20 June 2004, and the Canadian patent expired on 7 July 2004. Consequently, while Unisys has further patents and patent applications relating to improvements to the LZW technique, LZW itself (and consequently GIF) have been free to use since July 2004.


Alternatives


PNG

Portable Network Graphics Portable Network Graphics (PNG, officially pronounced , colloquially pronounced ) is a raster graphics, raster-graphics file graphics file format, format that supports lossless data compression. PNG was developed as an improved, non-patented ...
(PNG) was designed as a replacement for GIF in order to avoid infringement of Unisys' patent on the LZW compression technique. PNG offers better compression and more features than GIF, animation being the only significant exception. PNG is more suitable than GIF in instances where true-color imaging and alpha transparency are required. Although support for PNG format came slowly, new
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s support PNG. Older versions of
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
do not support all features of PNG. Versions 6 and earlier do not support
alpha channel In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pass ...
transparency without using Microsoft-specific HTML extensions.
Gamma Gamma (; uppercase , lowercase ; ) is the third letter of the Greek alphabet. In the system of Greek numerals it has a value of 3. In Ancient Greek, the letter gamma represented a voiced velar stop . In Modern Greek, this letter normally repr ...
correction of PNG images was not supported before version 8, and the display of these images in earlier versions may have the wrong tint. For identical 8-bit (or lower) image data, PNG files are typically smaller than the equivalent GIFs, due to the more efficient compression techniques used in PNG encoding. Complete support for GIF is complicated chiefly by the complex canvas structure it allows, though this is what enables the compact animation features.


Animation formats

Videos resolve many issues that GIFs present through common usage on the web. They include drastically smaller
file size File size is a measure of how much data a computer file contains or how much storage space it is allocated. Typically, file size is expressed in units based on byte. A large value is often expressed with a metric prefix (as in megabyte and giga ...
s, the ability to surpass the
8-bit color 8-bit color graphics are a method of storing image information in a computer's memory or in an image file, so that each pixel is represented by 8 bits (1 byte). The maximum number of colors that can be displayed at any one time is 256 per pixel or ...
restriction, and better frame-handling and compression through inter-frame coding. Virtually universal support for the GIF format in
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s and a lack of official support for video in the
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
standard caused GIF to rise to prominence for the purpose of displaying short video-like files on the web. * MNG ("Multiple-image Network Graphics") was originally developed as a PNG-based solution for animations. MNG reached version 1.0 in 2001, but few applications support it. *
APNG Animated Portable Network Graphics (APNG) is a file format which extends the Portable Network Graphics (PNG) specification to permit animated images that work similarly to animated GIF files, while supporting 24 or 48-bit images and full alpha ...
("Animated Portable Network Graphics") was proposed by
Mozilla Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
in 2006. APNG is an extension to the PNG format as alternative to the MNG format. APNG is supported by most browsers as of 2019. APNG provides the ability to animate PNG files, while retaining backwards compatibility in decoders that cannot understand the animation chunk (unlike MNG). Older decoders will simply render the first frame of the animation. : The PNG group officially rejected APNG as an official extension on 20 April 2007. : There have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches. Nevertheless, APNG is still under development by Mozilla and is supported in
Firefox 3.0 Mozilla Firefox 3.0 is a version of the Firefox web browser released on June 17, 2008, by the Mozilla Corporation. Firefox 3.0 uses version 1.9 of the Gecko layout engine for displaying web pages. This version fixes many bugs, improves standards ...
while MNG support was dropped. APNG is currently supported by all major web browsers including Chrome (since version 59.0), Opera, Firefox and Edge. * Embedded
Adobe Flash Adobe Flash (formerly Macromedia Flash and FutureSplash) is a mostly discontinuedAlthough it is discontinued by Adobe Inc., for the Chinese market it is developed by Zhongcheng and for the international enterprise market it is developed by Ha ...
objects and
MPEG The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by International Organization for Standardization, ISO and International Electrotechnical Commission, IEC that sets standards for media coding, includ ...
files were used on some websites to display simple video, but required the use of an additional browser plugin. *
WebM WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
and
WebP WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency. Google announced the WebP ...
are in development and are supported by some web browsers. * Other options for web animation include serving individual frames using
AJAX Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * Ajax (play), ''Ajax'' (play), by the an ...
, or animating
SVG Scalable Vector Graphics (SVG) is an XML-based vector graphics format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium sin ...
("Scalable vector graphics") images using
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
or
SMIL SMIL or Smil may refer to: *SMIL (computer), a Swedish first-generation computer *Synchronized Multimedia Integration Language, a www-standard markup language for multimedia presentations, including playlists and animated SVGs *Vaclav Smil (born 194 ...
("Synchronized Multimedia Integration Language"). * With the introduction of widespread support of the
HTML video HTML video is a subject of the HTML specification as the standard way of playing video via the web. Introduced in HTML5, it is designed to partially replace the object element and the previous de facto standard of using the proprietary Adobe Fla ...
() tag in most web browsers, some websites use a looped version of the video tag generated. This gives the appearance of a GIF, but with the size and speed advantages of compressed video. : Notable examples are Gfycat and
Imgur Imgur ( , stylized as imgur) is an American online image sharing and image hosting service with a focus on social gossip that was founded by Alan Schaaf in 2009. The service has hosted viral images and memes, particularly those posted on ...
and their GIFV metaformat, which is really a video tag playing a looped
MP4 MP4 (formally MPEG-4 Part 14), is a digital multimedia container format most commonly used to store video and audio, but it can also be used to store other data such as subtitles and still images. Like most modern container formats, it allows ...
or
WebM WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
compressed video. *
HEIF High Efficiency Image File Format (HEIF) is a digital container format for storing individual digital images and image sequences. The standard covers multimedia files that can also include other media streams, such as timed text, audio and vide ...
("High Efficiency Image File Format") is an image file format, finalized in 2015, which uses a
discrete cosine transform A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequency, frequencies. The DCT, first proposed by Nasir Ahmed (engineer), Nasir Ahmed in 1972, is a widely ...
(DCT)
lossy compression In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
algorithm based on the
HEVC High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard designed as part of the MPEG-H project as a successor to the widely used Advanced Video Coding (AVC, H.264, or MPEG-4 Part 10). In co ...
video format, and related to the
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
image format. In contrast to JPEG, HEIF supports animation. : Compared to the GIF format, which lacks DCT compression, HEIF allows significantly more efficient compression. HEIF stores more information and produces higher-quality animated images at a small fraction of an equivalent GIF's size. * VP9 only supports
alpha compositing In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pass ...
with 4:2:0
chroma subsampling Chroma subsampling is the practice of encoding images by implementing less resolution for Chrominance, chroma information than for luma (video), luma information, taking advantage of the human visual system's lower acuity for color differences t ...
, which may be unsuitable for GIFs that combine transparency with
rasterised In computer graphics, rasterisation (British English) or rasterization (American English) is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image (a series of pixels, dots or lines, whic ...
vector graphics Vector graphics are a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector displ ...
with fine color details. *
AV1 AOMedia Video 1 (AV1) is an open, royalty-free video coding format initially designed for video transmissions over the Internet. It was developed as a successor to VP9 by the Alliance for Open Media (AOMedia), a consortium founded in 2015 tha ...
video codec or
AVIF AV1 Image File Format (AVIF) is an open, royalty-free image file format specification for storing images or image sequences compressed with AV1 in the HEIF container format. It competes with HEIC, which uses the same container format built up ...
can also be used either as a video or a sequenced image.


Uses

In April 2014,
4chan 4chan is an anonymous English-language imageboard website. Launched by Christopher "moot" Poole in October 2003, the site hosts boards dedicated to a wide variety of topics, from video games and television to literature, cooking, weapons, mu ...
added support for silent
WebM WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
videos that are under 3 MB in size and 2 min in length, and in October 2014,
Imgur Imgur ( , stylized as imgur) is an American online image sharing and image hosting service with a focus on social gossip that was founded by Alan Schaaf in 2009. The service has hosted viral images and memes, particularly those posted on ...
started converting any GIF files uploaded to the site to
H.264 Advanced Video Coding (AVC), also referred to as H.264 or MPEG-4 Part 10, is a video compression standard based on block-oriented, motion-compensated coding. It is by far the most commonly used format for the recording, compression, and d ...
video and giving the link to the HTML player the appearance of an actual file with a .gifv extension. In January 2016,
Telegram Telegraphy is the long-distance transmission of messages where the sender uses symbolic codes, known to the recipient, rather than a physical exchange of an object bearing the message. Thus flag semaphore is a method of telegraphy, whereas pi ...
started re-encoding all GIFs to
MPEG-4 MPEG-4 is a group of international standards for the compression of digital audio and visual data, multimedia systems, and file storage formats. It was originally introduced in late 1998 as a group of audio and video coding formats and related ...
videos that "require up to 95% less disk space for the same image quality."


See also

*
AVIF AV1 Image File Format (AVIF) is an open, royalty-free image file format specification for storing images or image sequences compressed with AV1 in the HEIF container format. It competes with HEIC, which uses the same container format built up ...
*
Cinemagraph Cinemagraphs are still photographs in which a minor and repeated movement occurs, forming a video clip. They are published as an animated GIF or in other video formats, and can give the illusion that the viewer is watching an animation. A var ...
, a partially animated photograph often in GIF * Clear GIF, a technique used to check content access *
Comparison of graphics file formats This is a comparison of image file formats (graphics file formats). This comparison primarily features file formats for 2D images. General Ownership of the format and related information. Technical details See also * List of codecs Ref ...
*
GIF art GIF art is a form of digital art that first emerged in 1987. The technology for the animated GIF has become increasingly advanced through the years. After 2010, a new generation of artists focused on experimenting with its potential for presenti ...
, a form of
digital art Digital art, or the digital arts, is artistic work that uses Digital electronics, digital technology as part of the creative or presentational process. It can also refer to computational art that uses and engages with digital media. Since the 1960 ...
associated with GIF * GIFBuilder, early
animated GIF The Graphics Interchange Format (GIF; or , ) is a Raster graphics, bitmap Image file formats, image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite and released ...
creation program *
GNU plotutils GNU plotutils is a set of free software command-line tools and software libraries for generating 2D plot graphics based on data sets. It is used in projects such as PSPP and UMLgraph, and in many areas of academic research, and is included in ...
(supports pseudo-GIF, which uses
run-length encoding Run-length encoding (RLE) is a form of lossless data compression in which ''runs'' of data (consecutive occurrences of the same data value) are stored as a single occurrence of that data value and a count of its consecutive occurrences, rather th ...
rather than LZW) * Microsoft GIF Animator, historic program to create simple animated GIFs *
Software patent A software patent is a patent on a piece of software, such as a computer program, library, user interface, or algorithm. The validity of these patents can be difficult to evaluate, as software is often at once a product of engineering, something ...


References


External links


The GIFLIB project

spec-gif89a.txt
GIF 89a specification on w3.org
GIF 89a specification reformatted into HTML



Animated GIFs
a six-minute documentary produced by
Off Book (web series) ''Off Book'' is a web series on digital culture and art created for PBS by Kornhaber Brown, a Webby award-winning production studio that creates web series, videos, and motion graphics. The series has been viewed more than six million times, a ...
{{Compression formats Animated graphics file formats Raster graphics file formats CompuServe Open formats Computer-related introductions in 1987 Discovery and invention controversies