Detailed PNG image

1, PNG image type

PNG format 8, 24, 32 are three following are some terms:

  • Index transparent : Similar to GIF, a pixel is only through full and full opaque two effects
  • Alpha Transparency : translucent

PNG8

8-bit PNG supports up to 256 (2 to the power 8) color, 8-bit index of the transparent support and PNG alpha transparency.

PNG24

Support 2 power of 24 colors, but does not support transparent information.

PNG32

32 is the PNG PNG 24 on the basis of an increase of 8-bit transparency information, so that support different levels of semi-permeable effect.

to sum up

format Color Category Digit Transparent support
PNG8 8 th power of 2 8 not support
PNG8 + index transparent 8 th power of 2 8 Only support full penetration or full opaque
PNG8 + alpha transparent 8 th power of 2 8 Translucent support
PNG24 2 to the power 24 24 not support
PNG32 2 to the power 32 32 Translucent support

2, graphics software

Fireworks

In Fireworks, the above-mentioned various formats PNG can correctly generate, select the appropriate format as long as in the OPTIMIZE panel.

Fireworks导出PNG

Photoshop

In Photoshop (referred to as PS), PNG format can be selected by choosing the File menu's Save for Web & Devices achieved, attention:

  • PS does not support transparent PNG + alpha 8 format;
  • PS is also no 32-bit PNG option, but the fact is transparent PNG24 + PNG32.

Photoshop PNG export

3, browser support case

IE6 does not support PNG8 PNG32 and translucent effects of using filters solve the problem PNG32 translucent, but can not solve the translucent effect of PNG8.

Here we test the browser support for transparent PNG, where the use of filters for IE6 PNG images to load. The rest of the browser using the img tag. After testing, found to be consistent non-performance IE6 browser, but IE6 for PNG8 + alpha transparent support is not good enough, translucent image part is completely processed according to transparent manner. The test results shown below:

IE6 compatibility testing under PNG images

4, summary

  1. PNG format 8, 24, 32 three forms.
    • 8 PNG supports two different forms of a transparent (transparency and alpha transparency index);
    • 24 PNG does not support transparency;
    • PNG 32 on the basis of 24 8-bit alpha channel increases, so the degree of transparency may exhibit 256.
  2. Image processing tools
    • Photoshop : does not support output PNG8 + alpha transparent PNG;
    • Photoshop : 32 bit PNG is the output from the 24-plus-clear information in the form of PNG;
    • Fireworks : PNG support for the better.
  3. Browser support of
    • Non-IE6 browsers can properly display PNG images with transparency information (including index transparent and alpha transparency) of;
    • IE6 transparent PNG images can PNG32 with the help of filters
    • Whether or not, the translucent portion is completely processed in a fully transparent manner with the filter IE6;
    • IE6 for PNG8 + alpha transparent image support is not good enough.

Reference article

Most of this article is reprinted, editor: " talk about PNG point that thing ."

Reproduced in: https: //www.cnblogs.com/rainman/archive/2011/09/11/2173597.html

Guess you like

Origin blog.csdn.net/weixin_34104341/article/details/93561292