Differences between PNG file format PNG-24 and PNG-8

Source: Internet
Author: User
Tags transparent color

IE6 does not support only PNG Alpha channels (256-level adjustable translucent color), full transparent color in the PNG-8 index color is still supported.

PNG file formats are divided into PNG-24 and PNG-8, the biggest difference is that the PNG-24 is to use 24 bits to save a pixel value, is true color, the PNG-8 uses an 8-digit index value to index a color in the color palette, because the maximum value of an index value is 128 to the power of 2, therefore, the number of colors in the color palette is up to 128, so the file format is also called PNG-8128 imitation color.

PNG-24 because of its image capacity is too large, and in Nokia, Moto and other models to create images failed and display is incorrect and other exceptions occur, sometimes it will seriously slow the display speed, therefore, these exceptions are not commonly used. cocomo believes that these exceptions are irrelevant to the image decompression at the underlying platform layer. However, the biggest advantage of this format is that it can save the alpha channel, and colleagues have used this image format to achieve the precedent of Alpha mixing. As technology develops, the mobile phone hardware platform has improved, alpha mixing will certainly be widely used, and the biggest advantage of this format will be realized by that time.

IE6 does not support the transparency of the png24, but does support the transparency of the png8 index.
This article introduces a PNG hack dedicated to IE6, which is the famous iepngfix. HTC.

First download this to your site directory iepngfix. HTC
Write this condition into your head

XML/htmlCode

  1. <! -- [If lt IE 7]>
  2. <Style Type="Text/CSS">
  3. . Photo {behavior: URL (iepngfix. HTC );}
  4. </Style>
  5. <! [Endif] -->

Transparent differences between PNG-8 and PNG-24

PNG-8 and GIFThere are some similarities: The pattern is index color,Only pixel-level transparency is supported, and Alpha transparency is not supported.What we usually call "IE6 does not support PNG transparency" is that it does not support the transparency of the PNG-24 (the transparent area is displayed as gray ). However, IE6 supports PNG-8 transparency, just as it supports GIF transparency.

How do I generate images for PNG-8 and PNG-24? Use "Save As Web format" (shortcut: Alt + Shift + Ctrl + S) in PS, and select the image format in the Properties window on the right.

High compression ratio of PNG-8

When you cut the graph, sometimes you can choose a PNG-8 to get a higher compression ratio. Note that it is a PNG-8, not a PNG-24. However, in some cases, GIF or JPG files may be smaller. You need to debug the files based on the actual situation to select the best solution.

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.