Learn more about GIF

Jump to: navigation, search
Graphics Interchange Format <tr><td colspan="2" style="text-align: center; border: 0px solid #aaaaaa">Image:Rotating earth (small).gif
A rotating globe in GIF format. The gradient blue areas of this image transition choppily, a common GIF artifact produced when dithering is not employed.<tr><th style="white-space: nowrap;">File extension:</th><td>.gif</td></tr><tr><th style="white-space: nowrap;">MIME type:</th><td>image/gif</td></tr><tr><th style="white-space: nowrap;">Type code:</th><td>GIF </td></tr><tr><th style="white-space: wrap;">Uniform Type Identifier:</th><td>com.compuserve.gif</td></tr><tr><th style="white-space: wrap;">Magic:</th><td>GIF87a/GIF89a</td></tr><tr><th style="white-space: nowrap;">Developed by:</th><td>CompuServe</td></tr><tr><th style="white-space: nowrap;">Type of format:</th><td>bitmap image format</td></tr>
Image:Sunflower as GIF picture.gif
An example of a GIF image. The dithering process used to overcome the format's 256-color limitation makes the image appear coarse-grained.

GIF (Graphics Interchange Format) is an 8-bit-per-pixel bitmap image format using a palette of up to 256 distinct colors from the 24-bit RGB color space. The format was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web due to its wide support and portability. It also supports animations and even allows a separate palette of 256 colors for each frame.

A GIF image employs lossless data compression so that the file size of an image may be reduced without degrading the visual quality, provided the image can be rendered with only 256 colours. (However, there is a hack that can overcome this limitation under certain circumstances; see true colour.) This limitation makes the GIF format unsuitable for color photographs (which are more commonly seen in the JPEG format) and other images with continuous color, but well-suited for more simple images such as graphics or logos with solid areas of color. Monochrome photographs can be represented well as GIFs but still suffer from file size bloat due to the inappropriate compression technique.

Many software developers were surprised when it was revealed that the compression algorithm used by GIF had been patented by Unisys, and that they would have to pay royalties for writing programs that generated GIF files. The desire for a comparable format with fewer legal restrictions (as well as fewer technical restrictions such as the number of colours) led to the development of the PNG (Portable Network Graphics) standard.

The Software Freedom Law Center had stated that since 1 October, 2006, there are no significant patent claims interfering with employment of the GIF format. [1]

Although the original GIF and related patents have expired, PNG is still touted as a technically superior alternative, and has become the third most common image format on the web.


[edit] History

The GIF format was introduced in 1987 by CompuServe in order to provide a colour image format for their file downloading areas, replacing their earlier RLE format which was black and white only. GIF became popular because it used LZW data compression, which was more efficient than the run-length encoding that formats such as PCX and MacPaint used, and fairly large images could therefore be downloaded in a reasonable amount of time, even with very slow modems.

The original version of GIF was called 87a. In 1989, CompuServe devised an enhanced version, called 89a,<ref></ref> that added support for multiple images in a stream, interlacing and storage of application-specific metadata. The two versions can be distinguished by looking at the first six bytes of the file, which, when interpreted as ASCII, read "GIF87a" and "GIF89a", respectively.

When the World Wide Web gained popularity, GIF became one of the two image formats commonly used on Web sites, the other being the black and white XBM. JPEG came later with the Mosaic browser.

The GIF89a feature of storing multiple images in one file, accompanied by control data, is used extensively on the web to produce simple animations. The optional interlacing feature, which stored 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.

GIF images are limited to 256 colours, though it is possible to hack around this limitation, under certain circumstances, using the animation feature (see true colour, below).

[edit] Pronunciation

According to the creator of the "GIF" format, Steve Wilhite, the pronunciation is with a soft "g" and the acronym is pronounced like the peanut butter brand, Jif. To fellow employees of CompuServe he would often say "Choosy developers choose GIF", spinning off of the historically popular peanut butter commercial. This pronunciation was also identified by CompuServe in their documentation of a graphics display program called CompuShow. The documentation for version 8.33 in the FAQ section states:<ref></ref>
The GIF (Graphics Interchange Format), pronounced "JIF", was designed by CompuServe and the official specification released in June of 1987.

Despite this, many people pronounce the name with a hard "g" (as in "gift"). An online survey <ref></ref> indicates that this pronunciation is preferred by the majority of users, although given the self-selecting nature of its respondents the survey's credibility is questionable. Similarly, the same argument might be made of some pro-JIF sites.

[edit] Unisys and LZW patent enforcement

The LZW compression algorithm was covered by U.S. Patent 4,558,302, owned by Unisys Corporation. When CompuServe first developed the GIF format, they did not know that LZW was covered by a patent. In December 1994, after Unisys discovered that the newly popular file format used LZW compression, they announced that they would be seeking royalties on that patent; all commercial programs capable of producing GIF files would be required to pay a license fee to Unisys.

By this time, GIF was in such widespread use that most companies producing these programs had little choice but to pay. These problems were one factor leading to the development of the PNG format, which has become the third most common image format on the Web after GIF and JPEG.<ref>Security Space (July 1, 2006) Technology Penetration Report</ref>

In late August 1999, Unisys terminated its royalty-free LZW technology licenses for free software and non-commercial proprietary software and even for individual users of unlicensed programs, prompting the League for Programming Freedom to launch the Burn All GIFs campaign to inform the public of the alternatives.

Many legal experts have concluded that the patent does not cover devices that can only uncompress LZW data and cannot compress it; for this reason, the popular gzip program can read .Z files but cannot write them.

On June 20, 2003, the United States patent on the LZW algorithm expired,<ref></ref> which meant that Unisys could no longer collect royalties for use of the GIF format in that country. Those bothered by the patent enforcement dubbed this day GIF Liberation Day. The equivalent patents in Europe and Japan expired on June 18 and June 20 2004 respectively, with the Canadian patent following on July 7.

[edit] Usage

Although JPEG has replaced GIF in many situations, especially those where accurate representations of photographic-quality source images are required, the GIF format is still widely utilized. As it remains the only natively-supported animation format for most web browsers, GIF is frequently used to make small animations and short, low-resolution films for web pages. In addition, a large portion of web page logos and design element images are GIF (or, increasingly PNG) as those formats are better at successfully compressing images that contain large blocks of matte colour or of repeating patterns; JPEG does not compress flat, single-hued areas with sharp transitions to adjacent areas as well. Due to lingering browser issues related to rendering PNG transparency, GIF remains the only format that supports transparent images in almost all web browsers.

JPEG is preferred for digital photographs because it allows images to contain more than 16 million different hues (GIF gives a choice of only 256 per image frame) and it compresses photographs better. Uncompressed bitmap formats like Windows bitmap are sometimes preferred for images in computer software when speed is more important than reduced file size, because uncompressed bitmaps contain raw pixel information, and thus can be displayed more quickly.

[edit] Palettes

GIF is palette based: although any palette selection can be one of millions of shades, the maximum number that can be used in a frame is 256. These are stored in a "palette", a table which associates each palette selection number with a specific RGB value. The limitation to 256 shades seemed reasonable at the time of GIF's creation because few people could afford the hardware to display more. Simple graphics, line drawings, cartoons, and grey-scale photographs typically need fewer than 256 shades. Optionally, one of the selections in the palette can be set as transparent, which allows simple binary transparency.

There exist ways to dither or diffuse photographs by using pixels of 2 or more different hues to approximate an in-between hue, but this transformation inevitably loses some detail. The algorithms used to select the palette and to perform the dithering vary widely in output quality, giving dithering a possibly unwarranted bad reputation. Additionally, dithering significantly reduces the image's compressibility and thus works contrary to GIF's main purpose.

In the early days of graphical web browsers graphics cards with 8-bit buffers (allowing only 256 hues) were common and it was fairly common to make GIF images using the websafe palette which was based on the common subset of the standard Windows and Macintosh palettes. This ensured predictable display but severely limited the choice of hues. Now that 24-bit graphics cards are the norm, optimised palettes make less sense when creating images, though there are still many sites on web design that advise the use of the web safe palette.

[edit] True colour

GIF89a was designed based on the principle of rendering images (known as frames when used for animation) to a logical screen. Each image could optionally have its own palette, and the format provides flags to specify delay and waiting for user input between them (the latter is not widely supported by viewers). This is the feature that is used to create animated GIFs, but it can also be used to losslessly store a 24-bit RGB (truecolour) image by splitting it up into pieces small enough to be encoded into a 256 colour palette and setting up the GIF to render these with no delay on the logical screen.<ref></ref> However, most web browsers seem to assume that this multi-image feature will only be used for animation and insert a minimum delay between images. There will be some file size bloat from doing this, especially if the encoder doesn't support LZW for patent reasons. There are very few tools around that can easily produce 24-bit GIFs, and it is rarely an appropriate format unless there is absolutely no other option.

[edit] Alternatives

The PNG format was specifically designed to replace GIF for use as a single-image web format. PNG offers better compression and more features than GIF. The format has replaced GIF in many instances where true-color imaging, alpha transparency, and a lossless data format are required. Others have switched from GIF to PNG for reasons related to intellectual property concerns (see above).

All the features of GIF except animation are supported by PNG. As new web browsers support PNG, most GIF images could be replaced by PNG images if desired. However, Internet Explorer versions 6 and earlier do not support PNG's alpha channel transparency feature without using Microsoft-specific HTML extensions.<ref></ref> Using standard HTML <img> tags for PNG images in Internet Explorer can produce a look different from that intended. Internet Explorer 7 supports alpha channel transparency without hacks needed.

There have been occasional claims that PNG files are generally larger than GIFs. PNG files can indeed be much larger than GIF files in situations where a GIF and a PNG file were created from a high-quality master image, as PNG is capable of storing more color depth and transparency information than GIF, and due to the fact that GIF encoders often simplify complex images resulting in a lossy result. However, identical 8-bit (or lower) image data data rendered in PNG and GIF should yield similar sizes.[citation needed] Misinformation about PNG efficiency can generally be traced back to poor PNG support in older versions of some image manipulation programs, such as Adobe Photoshop that did not optimize PNGs for reduced color palettes by default.

MNG, a variant of PNG that supports animation, reached version 1.0 in 2001, but few applications support it. Animated GIF remains a widely used format as myriad applications are capable of creating the files, and it remains the only animated image format capable of being rendered in nearly all modern web browsers without the use of a plug-in. The ability to easily embed Flash objects, MPEG and other highly compressed lossy video on web pages has replaced animated GIF in some instances. Other approaches such as AJAX also facilitate sequential images animated via javascript. In 2004, a proposed extension to the PNG format called APNG was suggested. It would add the ability to animate PNG files, while retaining backwards compatibility in decoders which cannot understand the animation chunk. Older decoders would simply render a single frame of the animation.

[edit] References


[edit] See also

[edit] External links

Links related to the GIF patent issue:


ca:GIF cs:GIF de:Graphics Interchange Format es:Graphics Interchange Format eo:GIF eu:GIF fr:Graphics Interchange Format gl:GIF ko:GIF id:GIF it:Graphics Interchange Format he:GIF lt:GIF hu:GIF nl:Graphics Interchange Format ja:Graphics Interchange Format no:GIF pl:GIF pt:Graphics Interchange Format ru:GIF sk:GIF sl:GIF fi:GIF sv:GIF th:GIF vi:GIF tr:GIF uk:GIF zh:GIF


Personal tools
what is world wizzy?
  • World Wizzy is a static snapshot taken of Wikipedia in early 2007. It cannot be edited and is online for historic & educational purposes only.