What format is png?

PNG is a bitmap format that uses a lossless compression algorithm. PNG format has three forms: 8-bit, 24-bit, and 32-bit. Among them, 8-bit PNG supports two different transparent forms, 24-bit PNG does not support transparency, and 32-bit PNG adds 8-bit transparency channel on the basis of 24-bit. Can show 256 levels of transparency.



PNG is a bitmap format that uses a lossless compression algorithm. Its design purpose is to try to replace the GIF and TIFF file formats, while adding some features that the GIF file format does not have. PNG uses a lossless data compression algorithm derived from LZ77, and is generally used in JAVA programs, web pages or S60 programs because of its high compression ratio and small file size.

PNG format has three forms: 8-bit, 24-bit, and 32-bit, among which 8-bit PNG supports two different transparency forms (indexed transparency and alpha transparency), 24-bit PNG does not support transparency, and 32-bit PNG is added on the basis of 24-bit. With an 8-bit transparent channel, it can show 256 levels of transparency.

The numbers behind PNG8 and PNG24 represent the maximum color values ​​that can be indexed and stored in this PNG format. 8 represents 2 to the 8th power, which is 256 colors, and 24 represents 2 to the 24th power, which has more than 16 million colors.

Features

Due to bandwidth constraints in small size network communications, it is impossible to use large bmp format files on a web page on the premise of ensuring clear and lifelike pictures.

Lossless compression PNG files are compressed using a derivative algorithm of the LZ77 algorithm, and the result is a high compression ratio without data loss. It uses a special coding method to mark repeated data, so it has no effect on the color of the image, and it is impossible to produce color loss, so that it can be stored repeatedly without reducing the image quality.

The indexed color mode PNG-8 format is similar to GIF images, and also uses an 8-bit palette to convert RGB color images to indexed color images. What is stored in the image is no longer the color information of each pixel, but a representative color number selected from the image. Each number corresponds to a color, and the amount of data in the image is therefore reduced. This contributes to the spread of color images. Very advantageous.

More optimized network transmission shows that PNG images are streamed on the browser, even if the interlaced image will provide the viewer with a basic image content before it is completely downloaded, and then gradually become clearer. It allows continuous reading and writing of image data. This feature is very suitable for displaying and generating images during communication.

Supporting transparency effect PNG can define 256 transparency levels for the original image, so that the edge of the color image can be smoothly blended with any background, thereby completely eliminating jagged edges. This function is not available in GIF and JPEG.

PNG also supports alpha channel transparency for true color and grayscale images. Supports up to 24-bit true color images and 8-bit grayscale images. Support the transparency/translucency characteristics of the Alpha channel. Gamma calibration information for image brightness is supported. Support for storing additional text information to preserve image name, author, copyright, creation time, annotations and other information.

Guess you like

Origin blog.csdn.net/haojiao730/article/details/113967078