GIF (Graphics Interchange Format) is a bitmap image format for pictures with up to 256 distinct colours. The format was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web. GIFs are compressed files, and were adopted to reduce the amount of time it takes to transfer images over a network connection.
A GIF file employs lossless data compression so that the file size of an image may be reduced without degrading the visual quality. Contrast this to the JPEG file format which discards data to achieve file size reductions. The GIF format's 256-colour limitation makes it unsuitable for photographs. Therefore, GIF is normally used for diagrams, buttons, and drawings, that have a small number of colors, while the JPEG format is used for photographs.
Many software vendors were caught by surprise when it was revealed that the GIF format had been patented by Unisys and that they would have to pay royalties for writing programs that generated (or displayed) 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. Although the GIF patents will expire in the near future, PNG is still touted as a technically superior alternative, and has become the third most common image format on the web.