Graphics Interchange Format

from Wikipedia, the free encyclopedia
Graphics Interchange Format
File extension : .gif
MIME type : image / gif
Magic number : GIF87a / GIF89a
Developed by: CompuServe
Type: Bitmap - graphic format
Website : Specification GIF89a

The Graphics Interchange Format (Engl. Graphics Interchange Format ), short GIF (debate after inventor [ d͡ʒɪf ], but more often also [ gɪf ]), is a graphic format for images (with color palette color table with max. 256 colors, incl. A "transparent color "). It allows lossless compression of the images. In addition, several (superimposed) individual images can be saved in a file, which can be interpreted as animations by suitable viewing programs such as web browsers .


The by Steve Wilhite developed GIF was founded in 1987 by the US - online service CompuServe introduced the color format to replace the previously used RLE format that could only display black and white images. GIF became popular mainly because of its efficient LZW compression . The resulting image files required significantly less storage space than other graphic formats common at the time, such as PCX or MacPaint . Even large images could be transmitted in a reasonable time, even with slow modems . In addition, CompuServe's open license policy made it possible for every programmer to implement GIF for their own applications free of charge, as long as they made a reference to the copyright of the online service.

In the early years of the web , GIF was the second standard format for images, alongside the black and white image format XBM . The JPEG format that dominates today only became common after the introduction of the Mosaic browser. While the XBM format was completely superseded, GIF was able to assert itself because - in contrast to JPEG - it allows transparency and animation.

The first GIF version released in 1987 was version "87a". In 1989, CompuServe released an expanded version called "89a". You can tell the version by the first six bytes of a GIF file. These correspond to either the ASCII characters GIF87aor GIF89a.

In the 2010s, GIF animation made a surprising comeback on the web. The reason given is the popularity of image forum sites such as tumblr and 4chan , where they are used, among other things. a. Create cinemagraphs and stereograms .

In 2012, the word "GIF" was officially recognized as a noun and verb in the English language, as a verb meaning "to create a GIF". The US branch of Oxford University Press chose it as word of the year because GIF "has become a tool with serious applications in journalism and research ".

In May 2015, Facebook also started supporting GIF after initially being rejected. GIF is increasingly understood as a synonym for animated short videos, even if they are not technically available in this format.


Colors, transparency and image size

In photos like this one, the limitation to 256 colors is clearly noticeable. Dithering makes the image
look grainy.
The same picture as JPEG without these restrictions.

With GIF, the color information is stored in a color table (also called a color palette). This can contain up to 256 different entries that can be freely selected from 256 3 ≈ 16.7 million possible color values. When the image format was first introduced, this was not a major limitation as hardware that could display more colors was not widely used because of its very high cost. For simple drawings , black-and-white photographs and the like, 256 colors or shades of gray are usually still sufficient today. More complex images such as color photos or drawings with extensive color gradients must therefore be reduced to 256 colors or less before being saved ( color quantization ). The resulting color levels or dithering effects are particularly annoying with large images.

From GIF89a, a color entry in the palette can be defined as transparent. This allows the respective background color to shine through at any point and z. B. give the impression that the image is not rectangular in shape. Partial transparency ( alpha transparency) as with PNG is not possible: a pixel can only be either “fully visible” or “completely transparent”.

The maximum size of GIF images is 65,535 × 65,535 pixels.

GIF has the MIME types image / gif or image / giff .


Simulation of the interlace process

GIF87a already supports the storage of images with interlacing. The image is not transmitted sequentially from top to bottom, but in four passes with increasing resolution. This enables a rough representation of only partially transmitted images, which was used in particular with the often slow Internet connections in the 1990s to roughly display images on websites while the loading process was still in progress. The image data are not saved in sequence, but first every 8th line (from top to bottom), then every 4th, every 2nd and finally the remaining lines. When the graphic is displayed in the web browser, these lines are then initially displayed 8 times, then 4 times, and finally double, until all data has been loaded and the image is displayed 1: 1. In this way, even with a very slow connection, the viewer has a rough preview relatively quickly, which is then refined as the amount of data increases. A better method ( Adam7 ) was used for the PNG format.

Images with more than 256 colors

GIF image with 32,697 colors, obtained from several color tables, one per image block. ( Time-delayed construction due to non-specification-compliant interpretation of the browser of a delay value of 0 ms )
An animation that illustrates the creation of a high color GIF image.

GIF87a already offers the possibility to save several single images, each of which can have its own color palette (Local Color Table), in a file. This option can be used to save true color images (true color GIFs). In contrast to the animated GIFs, these are not played one after the other, but are set up next to one another. For this purpose, the whole picture is divided up like a chessboard ( tile graphic ) into individual pictures with no more than 256 colors, each with its own palette. This means that images with 24-bit color depth can also be saved and displayed in GIF without loss and in compliance with standards. Since the individual images are compressed independently of one another and also each require an uncompressed local color palette of 6 to 768 bytes in length, a good compression rate can usually no longer be achieved with such "true color GIFs".

True-color GIFs can be used e.g. B. with PhotoImpact or the free ANGIF library from Phil Howard, which is under the GPL . Konqueror , Apple Safari and Netscape Communicator 4.7x show them immediately and correctly. However, IrfanView , Firefox , Internet Explorer and Opera only display the individual frames with mandatory pauses of approx. 100 ms in between, which can give the impression of an animation until the image is completely constructed. True-color GIFs can easily be imported into the GIMP graphics program as 24-bit RGB images , but they cannot be exported. The image viewer XnView showed severe graphic errors up to version 1.96, the image is not recognizable. The Windows XP image display only reports an error and does not display the image. The programs Reggae and SView5 display the files without any problems.

Photoshop can display, edit, and save any variant of GIF.

Another technique to be able to display real color images with GIFs uses the transparency introduced with GIF89a: a GIF file can be constructed as a series of overlapping images, each with its own 256-color table, in which the underlying image components are transparent single pixels the one above it become visible.

True color GIFs have so far not achieved great popularity and distribution, possibly also because most GIF decoders in image viewers and browsers, contrary to the specification, interpret a delay value of 0 ms between the individual frames of the GIF as typically 100 ms, although the specification explicitly forbids this:

"8th. The decoder. The decoder has the following primary responsibilities. - Process each graphic in the data stream in sequence, without delays other than those specified in the control information. [...] ”

"8th. The decoder. The main function of the decoder is as follows. - Process the graphics from the data stream one after the other, without delays, except for those that are specified in the control information. [...] "


A repeating GIF animation of the earth

The ability of GIF to save multiple frames can be used for animation. There is no official description of the format used, but it has established itself as a de facto standard among browser manufacturers. The individual images are played back one after the other by the web browser or the image processing program. This animation option also made it possible for the first time to transfer short, film-like files. Animated GIFs were therefore widely used and are still in use.

GIF enables animations that are constantly repeated (see globe on the right) or animations that run only once or a few times and then stop at the last image.

GIF and the LZW patents

In 1994, the software company Unisys discovered that it held a software patent filed in 1983 on the LZW process used in the GIF and then demanded license fees from CompuServe. The two companies agreed that CompuServe would receive a license from Unisys, which could then be passed on to manufacturers of commercial programs that use GIF. CompuServe demanded a basic fee of one US dollar and 1.5% of the sales proceeds of the software, but at least 15 cents per copy sold. The validity of this license was also limited to programs that worked together with the CompuServe online service.

Later the LZW algorithm could also be licensed directly from Unisys. At that time, GIF was so widespread on the World Wide Web that hardly any manufacturer could oppose Unisys's demands. Although free software and non-commercial products were initially exempt from Unisys' licensing requirements, these led to the development of PNG .

In 1999 Unisys declared that license fees would now also have to be paid for free software. At the same time, legal action was taken against individual users who used GIF images on their websites that were generated by unlicensed software.

The US patent expired on June 20, 2003; in the United Kingdom , France , Germany and Italy the patent was valid until June 18, 2004, in Japan until June 20, 2004 and in Canada until July 7, 2004.

Furthermore, the company IBM was granted a patent on the same process; this is due to a mistake by the US Patent Office . The registration took place three weeks before that of Unisys; however, under US patent law, this does not mean that the IBM patent has priority. Rather, the IBM patent is likely to be invalid due to the previously granted Unisys patent. It would have expired on August 11, 2006.

According to the Software Freedom Law Center , the last major patents on the use of GIFs expired on October 1, 2006, so free use is now possible. A representative of Unisys commented on the expiry of the patent:

“We haven't evaluated the new recommendation for PNG, and it remains to be seen whether the new version will have an effect on the use of GIF images. If so, the patent situation will have achieved its purpose, which is to advance technological innovation. So we applaud that. "

“We haven't assessed the new [W3C] recommendation for PNG, and it remains to be seen whether the new version will affect the use of GIF images. If so, then the patent situation will have served its purpose, namely to promote technical innovation. We therefore welcome that. "

Comparison with more modern standards

The patent-free PNG format was developed to replace GIF as the format for individual images on the World Wide Web . PNG offers more options (up to 64 bit color depth), almost always better compression and can save more colors per single image than GIF. The latter is the biggest advantage of PNG over GIF.

However, despite the license fees for the LZW process, PNG GIF could not harm it for a long time because, until the patent expired on the LZW process, it was almost only private individuals who replaced their GIFs with PNG images in protest against the Unisys licensing policy. Companies preferred to pay because most browsers did not support the PNG format properly or not at all. In addition, PNG - unlike GIF - cannot display animations. It is only since most web browsers support the PNG format that its use has increased. Since 2009, PNG has been able to replace the outdated GIF in many areas (except for animation) thanks to its technical advantages.

The animation format MNG , which was developed for PNG, has not yet caught on. For this reason, Mozilla proposed a PNG extension called APNG , which can display animations in addition to images and can therefore be considered a complete GIF replacement. The advantage over MNG is that browsers or software in general that do not support APNG (such as Internet Explorer ) of animations in this format at least display the first image. However, APNG was not accepted as a PNG extension by the PNG Group in 2007. Nevertheless, Mozilla continues to develop APNG, e.g. B. the versions of Firefox (3.0) and Opera (9.50) released in June 2008 support APNG, but no longer MNG.

As a modern alternative to animated GIFs, video files can be integrated directly with HTML5 . Common formats include WebM , H.264 and Theora . The quality of the animation improves considerably, it requires less storage space and the display of interactive control elements improves the usability. If only simple movements of objects are to be displayed, CSS3 animations can possibly be used.

Although GIF can be regarded as technically out of date, it has not yet been completely replaced due to its widespread use, its level of popularity and its usability for animation.

Dissemination and use

Soon after its introduction as a web format, GIF images were used more widely, e. B. from programs such as computer games , DOS or databases . In the early days of the web, photos and other real-color graphics were mostly stored in GIF, although technically poorly suited for this. The true color graphics, which were not very widespread at the time, were reduced to 256 colors or less (mostly using dithering). GIFs in this application are therefore still often to be found on the few websites that have existed (almost) unchanged since then. For photographs and other applications that require great color depths, and as a general purpose image format, GIF has been uncommon since the 2000s.

However, despite competition from PNG, GIF images continue to be used in large numbers on the Internet, especially for banners , smaller images, and for animation. GIF animations (for example rotating or blinking text elements) were often used as eye-catchers and as the first dynamic multimedia elements on many otherwise static websites at the beginning of the popularity of the WWW , before the year 2000 (which also earned them the joking nickname "fidget GIF" ). Although technically obsolete, GIF animations made another comeback on the web in the 2010s and are used, for example, to create cinemagraphs or stereograms . The reason given is the popularity of image forum sites such as tumblr and 4chan . Another reason is the broad-band and good technical support of animated GIFs across all browser and operating system limits, in contrast to technically more modern alternatives such as SVG , Flash or animated PNGs , which often require additional codecs or browser plug-ins .

Animated GIFs as triggers for epileptic seizures

In March 2017, a case emerged in which an epileptic was forced into a seizure by a tweet with an animated GIF.

Format comparison for real color image

See also


  • Thomas W. Lipp: Graphic formats . Microsoft Press, Unterschleißheim 1997, ISBN 3-86063-391-0
  • John Miano: Compressed Image File Formats . Addison-Wesley, Reading 2000, ISBN 0-201-60443-4
  • Jörg Stroisch, Thorsten Olscha: Web graphics optimization . Markt und Technik, Munich 2003, ISBN 3-8272-6530-4

Web links

Wiktionary: GIF  - explanations of meanings, word origins, synonyms, translations
Commons : GIF file format  - collection of images, videos and audio files

Individual evidence

  1. Gif's inventor says ignore dictionaries and say 'Jif'. BBC News, May 22, 2013, accessed May 24, 2013 .
  2. Werner Pluta : Steve Wilhite - Honor for the inventor of the "Jif" format., May 22, 2013, accessed on May 24, 2013 .
  3. Gif | Define Gif at Collins English Dictionary - Complete & Unabridged 10th Edition, 2009, accessed May 24, 2013 .
  4. a b Retrochic: Animated GIFs are making their comeback . . February 14, 2013. Retrieved on July 2, 2013: " The images from primeval times of the Internet that were believed to have disappeared are increasingly reappearing "
  5. a b Anil Dash: Animated GIFs Triumphant ( English ) July 12, 2011. Archived from the original on May 27, 2013. Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. Retrieved on July 2, 2013: “ Due to the power and ubiquity of what may be the world's most popular format for the moving image: The humble animated GIF image. " @1@ 2Template: Webachiv / IABot /
  6. a b Digital flip book on the road to success - not Twitter, not Instagram and certainly not Facebook was the web trend in 2012, but an actually reanimated oldie: The animated GIF has started its late triumphant advance through the internet. It combines the advantages of a picture as a relatively small file, for which no video player is required, and those of the video. . December 29, 2012. Retrieved on July 3, 2013: “ In posting forums - above all at the anarchist picture forum 4chan - the trend has now spread to use GIFs as an emoticon replacement. […] The hype went away Hand in hand with the upswing of the picture blog platform Tumblr, which broke the 20 billion post mark this year. The GIFS also found their way into Twitter and Google+. "
  7. Elizabeth Flock: Cinemagraphs: What it looks like when a photo moves ( English ) Washington Post . July 12, 2011. Retrieved July 28, 2013.
  8. a b Stereogranimator on (English)
  9. Alison Flood: Gif is America's word of the year? Now that's what I call an omnishambles | Alison Flood | Books | ( English ) Guardian. April 27, 2013. Retrieved May 1, 2013.
  10. Oxford Dictionaries USA Word of the Year 2012 | OxfordWords blog ( English ) November 13, 2012. Retrieved May 1, 2013: " " a tool with serious applications including research and journalism " "
  11. Molly McHugh: You Can Finally, Actually, Really, Truly post GIFs on Facebook ( English ) . May 29, 2015. Retrieved May 29, 2015.
  12. Sarah Perez: Facebook Confirms It Will Officially Support GIFs ( English ) . May 29, 2015. Retrieved May 29, 2015.
  13. a b About the Animated GIF Format on (English)
  14. True-Color GIF Example ( English ) 2000. Archived from the original on September 3, 2000. Retrieved July 2, 2013.
  15. Writing strategy for true color GIFs, details at
  16. angif on (English)
  17. XnView Changelog : “Animated GIF, decoding now in 32bits to support correclty format”
  18. Itsagif ( s ) Pedagoguery software. Retrieved July 2, 2013.
  19. Animated GIF Minimum Frame Delay Browser Compatibility Study
  20. They're different! How to match the animation rate of gif files accross browsers
  22. Lipp, p. 308
  23. Message "GIF is now free of patent rights" on heise online
  24. Bell tolling for PNG graphics format? CNET, June 9, 2003
  25. VOTE FAILED: APNG 20070405a . SourceForge mailing list. April 20, 2007. Retrieved September 21, 2013.
  26. Bug 195280 - Removal of MNG / JNG support
  27. Bug 18574 - restore support for MNG animation format and JNG image format
  28. a b M. Frandsen, Y. Zhang: GIF to HTML5 Video - Optimizing GIF for Modern Browsers . In: 2014 11th Web Information System and Application Conference . September 2014, p. 75-78 , doi : 10.1109 / WISA.2014.22 .
  29. GIF as a "deadly weapon" - spectacular trial in the USA