PNG Picture Summary

Source: Internet
Author: User

Png:

Portable Network Graphics (Portable networks graphics,png) is a lossless compression bitmap graphics format that supports features such as index, grayscale, RGB three color schemes, and alpha channels. PNG's development goal is to improve and replace GIF as a format for network transmission without patent licensing, so it is widely used in the Internet and other aspects.

PNG Another unofficial name is derived from the recursive abbreviation: "PNG is Not GIF".

Features
    • Supports 256 color palette technology to produce small volume files
    • Up to 48-bit true color images and 16-bit grayscale images are supported.
    • Supports transparent/translucent properties of the alpha channel.
    • Gamma calibration information that supports image brightness.
    • Support for storing additional text information to preserve image names, authors, copyrights, authoring time, annotations, and more.
    • Use lossless compression.
    • Asymptotic display and streaming read and write, suitable for quick display of preview in network transmission and then display the whole picture.
    • Use CRC to prevent file errors.
    • The latest PNG standard allows multiple images to be stored within a single file.

Since PNG is lossless compression, it means that he can re-refine the original picture (1. Filter, 2. Compress).

1. Filtration (Filtering)

Differential coding: Also known as incremental coding, a simple example of differential coding is the difference between stored sequence data (rather than the storage of the data itself): No "2,3,4,5,6,7,8", but "2,1,1,1,1,1,1".

[2,3,4,5,6,7,8] can become [2,1,1,1,1,1,1], where

[2, 3–2=1, 4–3=1, 5–4=1, 6–5=1, 7–6=1, 8–7=1]

It is not very useful to use alone, but it can help compress data when the sequential values are often present. Because the changes are usually small (averaging 2% of the total size), differential coding can significantly reduce duplication of data. A series of unique delta files is more efficient in space than an encoded equivalent file. differential compression in Windows is also a way to use this encoding

PNG image storage is also a differential encoding, which is filtering.

2. Compression

The LZ77 compression algorithm is used mainly.

Reference: https://medium.com/@duhroach/how-png-works-f1174e3cc7b7

About the format of PNG:

If you do not use transparency (alpha), the RGBA 32bpp option wastes the ¼ of the image size, and can be used with 24BPP TrueColor format (or just use JPG). Of course, if the picture contains gray pattern data, you should only use 8BPP. Storage. In short, the pixel storage format, the choice needs the heart.

INDEXED format.

INDEXED color mode, basically chooses the best of colors to use, and replaces all your pixels with an index into that Col or palette. The result, is a reduction from million colors (24BPP) to-which, is a significant savings.

Reference: https://medium.com/@duhroach/REDUCING-PNG-FILE-SIZE-8473480D0476#.UT4MVXKCV

PNG Picture Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.