GIF is a standard format for compressing images with monotonous colors and clear details, such as line graphs, logos or illustrations with text.
history
In the early days, the LZW compression algorithm used in GIF was a free algorithm developed by Compuserv. However, to the surprise of many software developers, the compression algorithm used in GIF files suddenly became the patent of Unisys. According to Unisys, they have registered the W part of the LZW algorithm. If you want to develop a program to generate (or display) GIF files, you need to pay royalties to the company. Therefore, people began to seek a new technology to reduce the development cost. PNG (Portable Network Graphics) standard came into being under this background. On the one hand, it meets the market demand for less legal restrictions, on the other hand, it also brings less technical restrictions, such as the number of colors. On June 20, 2003, the patent right of LZW algorithm in the United States expired. Patents in Europe, Japan and Canada also expired on June 18, June 20 and July 7, 2004 respectively. However, with its technical advantages, PNG file format has become the third most widely used format on the network. GIF related patents expired on August 1 1, 2006.
principle of operation
GIF (Graphic Interchange Format) originally means "Image Interchange Format", which is an image file format developed by CompuServe Company in 1987. The data of GIF file is a continuous tone lossless compression format based on LZW algorithm. Its compression ratio is generally around 50%, which does not belong to any application. At present, almost all related software supports it, and a large number of software in the public domain are using GIF image files. The data of GIF image file is compressed by variable length compression algorithm. Therefore, the image depth of GIF varies from lbit to 8bit, which means that GIF can support 256-color images at most. Another feature of GIF format is that images with multiple colors can be stored in a GIF file. If the data of multiple images stored in a file are read out one by one and displayed on the screen, the simplest animation can be formed.
classify
GIFs are divided into static GIFs and animated GIFs, which support transparent background images and are suitable for various operating systems. "Body shape" is very small, and many small animations on the Internet are in GIF format. In fact, GIF is to save multiple pictures as a picture file to form an animation, so in the final analysis, GIF is still a picture file format. But GIF can only display 256 colors. GIF is mainly divided into two versions, namely GIF 89a and GIF 87a:GIF 87a: 1987; GIF 89a: 1989. In this version, the GIF document extends four blocks: graphic control block, remarks, description and application programming interface, and it provides support for transparent colors and multi-frame animation. Since 1987 CompuServe introduced the GIF format, it has been very popular since then because of its small size and relatively clear image, which is especially suitable for the early slow network speed. It uses lossless compression technology, as long as the image does not exceed 256 colors, it can not only reduce the file size, but also maintain the image quality. (Of course, there are some hack technologies that overcome the limitation of 256 colors under certain conditions. See True Color for details. However, the limitation of 256 colors greatly limits the application scope of GIF files, such as color cameras. (Of course, color camera photos with lossless compression technology are not suitable for transmission through the network. On the other hand, JPG format has good performance on high-color pictures, but it is not effective on simple polylines. Therefore, GIF format is generally suitable for charts, buttons and other images that only need a few colors.