This afternoon, when Ergouzi went to work and fished as usual, he suddenly saw a message that the inventor of GIF had passed away due to the new crown. As a self-proclaimed rational Internet person, Ergouzi's first reaction was to see an outrageous rumor, but after checking multiple sources, Ergouzi sadly found that it was true.
Stephen Wilheit worked at CompuServe, the world's first Internet service provider, when the company wanted to display information such as color weather maps online, but was unable to do so due to limited network bandwidth. Stephen Wilheit knew some compression techniques, so he got involved in creating the GIF format. In 1978, CompuServe launched the GIF format, the world's first moving picture was born.
GIF stands for Graphics Interchange Format, that is, graphics interchange format, which reproduces true-color images in 8-bit colors (ie, 256 colors). It effectively reduces the transmission time of image files on the network, and is one of the widely used network transmission image formats on the Internet.
In addition to GIF, there are the following types of image formats widely used on the Internet:
- JPEG
- png
- WebP
GIF
Earlier we also mentioned a little introduction about GIF. As its biggest feature, which is different from JPEG and PNG formats, GIF is "dynamic". We typically use GIFs to create animations from image files, which can be transferred and stored losslessly by incorporating lossless quality in compression with less storage impact on image libraries.
GIFs are lossless, and saving pictures in GIF format will not degrade the picture quality. Thanks to the compression of the data, the file size is small, which is also an advantage of the GIF format. Additionally, it has support for animations as well as transparent backgrounds.
The GIF format is suitable for scenarios that do not require high color and require a small file size, such as corporate logos, wireframe diagrams, etc. Because of its small size, GIF has also been widely used in various websites now.
JPEG
JPEG stands for Joint Photographic Expert Group, which is the Joint Photographic Expert Group. It is a compression standard for continuous-tone still images developed by the International Organization for Standardization (ISO). It is the official extension of what we often call JPG, so why does the term JPG appear? This is because the 8.3 naming convention adopted by early systems such as DOS and Windows 95 only supports extensions with a maximum length of 3 characters, so the .jpg format is used for compatibility. Later, all Apple's machines did not limit the extension length, allowing JPEG to appear in full. However, because everyone already likes the way of calling JPG, so JPG is still very popular now.
The design goal of the JPEG image format is to compress the file size as much as possible without affecting the quality of the image that can be distinguished by humans. This means that JPEG removes some of the original information from the image, which is a lossy compression. The advantage of JPEG pictures is that they use direct color. Thanks to the richer colors, JPEG is very suitable for storing photos and expressing more vivid image effects, such as color gradients.
However, JPEG is not suitable for storing corporate logos and wireframes. Because lossy compression will result in blurred images, and the selection of direct colors will result in larger image files.
PNG
PNG stands for Portable Network Graphics, which means portable network graphics. It was developed in 1994 by a working group of the World Wide Web Consortium (W3C) to create a modern, free alternative to the GIF format.
PNG adopts the bitmap format of lossless compression algorithm, and the file extension is .png. It uses a lossless data compression algorithm derived from LZ77, which is generally used in JAVA programs and web pages. It has a high compression ratio and generates a small file size.
The PNG format is the format we use most often in our digital design projects, and typically has a larger file size than other formats. But it retains the hard edge effect and can handle a lot of color. In addition, PNG has a more interesting feature, that is, it supports transparent background, so most websites use PNG format as Logo.
Seeing this, I believe that everyone has found something in common among the three. They all mention compression and damage, some are lossy, and some are lossless. Do all images have to be compressed? In fact, it can be uncompressed. For example, BMP can be stored without compression. But one or two pictures can still be done. If there are too many pictures, it will cause great pressure on storage and transmission.
Therefore, it becomes important to compress pictures to save traffic bandwidth, make transmission faster, and bring better viewing experience without changing the picture quality.
However, as traditional image formats JPEG, PNG, GIF, etc., there is not much room for optimization, and the only remaining way is to discover a new image format or compression format to solve this problem, and WebP came into being.
WebP
WebP is a new image compression format proposed by Google in 2010, the purpose is to provide excellent lossy and lossless compression for image resources on the Web. Provides smaller and richer image resources under the same quality index as other formats, so that resources can be accessed and transmitted on the Web.
The WebP image format comes from the VP8 video codec, which is the WebM video container, which is a single compression framework for the WebM video format. One of the great features of the VP8 codec is its ability to do intra-frame compression, or rather, the ability to compress each frame of the video and compress the differences between frames.
As a format designed for compression, WebP has the following characteristics:
- Lossy compression: Lossy compression is based on VP8 key encoding. VP8 is a video format created by On2 Technologies, the successor to the VP6 and VP7 formats.
- Lossless compression: Compression using techniques such as predictive transformation, color transformation, green subtraction, LZ77 echo reference, etc.
- Transparency: An 8-bit alpha channel is useful for graphic images. Alpha channel can be used with lossy RGB. WebP-specific features not supported by other formats of images.
- Animation: It supports true color animated images, i.e. can support dynamic graphs (Gif-like graphs)
- Metadata: It may have EXIF and XMP metadata
- Color Profile: It may have an embedded ICC profile.
At the same time, its effect is also obvious. Compared with JPEG, when WebP compresses JPEG to 90% of the original image quality, the image volume can be reduced by about 50%. When WebP compresses JPEG to 80% of the original image quality, the image volume is reduced by 60%~80%.
After the emergence of WebP, it quickly became popular in major websites and apps with its excellent image compression performance, both lossless and lossy compression algorithms, and the only feature that can compress GIF. So how can we make the image into WebP format?
The easiest way is to directly access the image processing function of the cloud service, such as taking another cloud WebP adaptive:
One-click to enable the WebP adaptive function in the background, you can intelligently determine whether the client browser supports WebP decoding through the CDN platform. any changes.
Recommended reading
The interviewer asked, is Redis single-threaded or multi-threaded? I am confused
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。