What is PNG?


photo of John Michael Pierobon By: John Michael Pierobon

PNG stands for Portable Network Graphics. The World Wide Web Consortium (W3C) writes "PNG is an extensible file format for the lossless, portable, well-compressed storage of raster images. PNG provides a patent-free replacement for GIF and can also replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images are supported, plus an optional alpha channel for transparency. Sample depths range from 1 to 16 bits."

The W3C develops guidelines, specifications, and tools for the World Wide Web.

PNG is an image specification specifically designed for the Web. The irony is that many Web developers do not know about it and many Web surfers have never heard of PNG.

A major reason why PNG is not widely used is because of lack of industry support. Both Netscape and Microsoft have been very slow to incorporate support for all of the features of PNG. Old browsers, Netscape 2.02 for example, cannot render PNG images. Newer browsers can render PNG images, but not to its full extent.

Two important features not fully supported are alpha channel and gamma correction. Alpha channel (also called mask channel) allows for variable transparency, so images with transparent backgrounds blend into whatever color they are placed against. Gamma correction accounts for cross-platform differences in the brightness of images, so images will always look the same no matter the browser.

The GIF format only offers simple binary transparency, meaning that any given pixel is either fully transparent or fully opaque; nothing in between. The variable transparency feature of PNG is a big improvement over GIF because an image editor can adjust the alpha channel to reflect the desired opacity or transparency of the image.

All three PNG image types (truecolor, grayscale and palette) can have alpha information. PNG stores red, green, blue, and alpha (RGBA) information for every pixel. Thus, for example, variable transparency works very well with drop shadows and images with feathered effects.

The GIF format only supports 256 colors, while the PNG format supports millions of colors more than what the human eye can detect. Hence PNG supports truecolor images.

Another PNG advantage is compression. In almost every instance, PNG has better compression than GIF. Better compression means images download faster.

PNG and GIF compression is "lossless". Lossless compression means no information about the image is lost. With "lossy" compression, information is lost. Lossy compression is possible with JPEG, and sometimes it may be necessary to sacrifice image quality (and data) for the sake of image size and download time. There are times when a JPEG image format is better than PNG, but PNG was designed to replace GIF, not JPEG.

PNG does not support animation because the developers of PNG feel mixing still images and animation images in one format is bad design. However, there is another image format called Multiple-image Network Graphics (MNG) which supports animation. MNG is in essence a superset of PNG.

When PNG is fully supported by all browsers, it may achieve its intended purpose of replacing GIF. For now, you know what it is, and its purpose.

John Michael Pierobon is an Internet consultant based in Fort Lauderdale.
John Michael may be reached by sending electronic mail to pierobon@pierobon.org


Home | Résumé | Courses | Comments | HTML | Definitions | Articles | Books


Thank you for visiting.

© 2001 - 2006 John Michael Pierobon