First off, why use PNG instead of GIF? Probably the most important reason is that GIF supports a maximum of 256 colors. The second reason is Unisys has a lockdown on the rights to LZW compression which the GIF format can, and usually does use. PNG overcomes the color depth hurdle by providing up to 48Bpp (bits per pixel). Just as importantly, the PNG format is patent-free and available for use by anyone.
PNG has other advantages over GIF as well:
- Alpha Channels: GIF supports binary transparency, that is a pixel can either be opaque or transparent. PNG allows full variable transparency with 254 levels of partial transparency. I should also say that it is also possible to obtain 65,534 levels of transparency, but that is out scope for web graphics.
- Gamma Correction: This allows authors the ability to correct the differences in an image that arrise from being viewed by different monitors. Most notibly is the difference between PC and Macintosh.
So we know PNG offers us plenty of features and flexibility, but how do we use that? It just so happens GDI+ supports PNG, but there are a few extra steps involved in using it.
Join the conversation! Your thoughts help the community grow.