PNGs, one and all

 

Portable Network Graphic (PNG)

By Greg Kail
DMST 3502, Mike Brittain
February 19, 2001

The Portable Network Graphic (PNG) is a versatile web graphic file format that's superior in many ways to existing image formats, but lacks the universal browser and application support necessary to make it an Internet standard. However, PNG has a good chance of becoming one of the web's most popular image file formats because of its open code, alpha transparency support, outstanding color support and its lossless compression. As older browsers become irrelevant and image-editing applications evolve to take advantage of PNG's specifications, PNG is likely to become a regular on the worldwide web and throughout the digital media.

PNG's History

PNG's birth in the mid-1990s was largely a reaction to the furor created when software developer Unisys began demanding royalties from companies using its LZW compression technique. The specifications for LZW compression had been used by software makers for several years, and the format was considered open code throughout the industry. CompuServe employed LZW compression in its Graphic Interchange Format (GIF), which had become an industry standard.

Financially ailing Unisys pursued CompuServe aggressively for compensation beginning in 1993. During the 1994 Christmas holidays, CompuServe announced that it would begin collecting royalties from software makers who supported the GIF file format in their products. The Internet graphics community was furious, and the seeds were sown for the creation of a new image file format.

A makeshift work group of Internet graphic programming gurus formed, largely through a Usenet newsgroup. Programmer Thomas Boutell assumed leadership of the group, which set out to create a GIF replacement that would be -- in the spirit of the Internet -- free to developers. Within a week, the first draft of the PNG format had been posted, and the road toward today's PNG was paved.

PNG received a huge boost in its chances for survival in October 1996 when the W3C consortium for web standards recommended that web software developers support the PNG format. The rationale for the decision was as follows:

Does the world really need yet another graphics format? We believe so. GIF is no longer freely usable, but no other commonly used format can directly replace it, as is discussed in more detail below. We might have used an adaptation of an existing format, for example GIF with an unpatented compression scheme. But this would require new code anyway; it would not be all that much easier to implement than a whole new file format. (PNG is designed to be simple to implement, with the exception of the compression engine, which would be needed in any case.) We feel that this is an excellent opportunity to design a new format that fixes some of the known limitations of GIF. [4]

 

Today, PNG enjoys at least partial support from the latest versions of the most popular browsers, including Netscape and Microsoft Internet Explorer. Image software makers have also warmed up to PNG. Adobe Photoshop, FreeHand and many other widely used image editors support PNG. O'Reilly and Associates, one of the best-known publishers of technical computer books, published PNG: The Definitive Guide in June of 1999, further boosting the format's long-term credibility.

PNG's greatest exposure in the industry may be through Macromedia's Fireworks software, which was developed to optimize images for the web. PNG is the native file format in the software. When Fireworks users crop images, apply effects or otherwise enhance them, they do their work on PNG files. If the designer wishes to post the image in a different format, he or she exports to that format. The Macromedia web site explains its choice of native format saying, "PNG, like Fireworks, is designed for the Web." [8]

Greg Roelofs, who maintains the official PNG web site, observed in a Feb. 1999, "Slashdot" article:

"[PNG] has advanced from being a newsworthy 'extra' to being an expected, standard component of image applications; in other words, a viewer or editor that ships without PNG support is considered deficient by both consumers and the trade press." [1]

PNG's Advantages

Although originally created as a replacement for GIF, PNG has proven itself useful in two related but very different areas of the digital landscape: the Internet and image editing. As more designers become aware of what PNG does well -- and what it is not -- PNG is likely to gain wider acceptance in both spheres.

On the web, PNG is most heralded for its alpha channel support, its gamma correction capabilities and its ability to allow for progressive displays. With regard to alpha channels, GIF allows only for "binary transparency." That means a pixel can either be entirely transparent or not transparent at all. Yet PNG has more than 250 levels of transparency. The format uses four bytes for each pixel: red, green, blue and alpha. This allows for effects such as drop shadows to work well against backgrounds with varying colors.

PNG goes a long way toward solving one of the peeves of serious designers who use both Macintosh and PC platforms. Often, images created on Macs look dark on PCs, and images created on PCs look light on Macs. The PNG format corrects that problem to a large extent, although differing monitor settings can still give unexpected results.

Interlacing, the ability to progressively display images as they download on the web, has been used on the web for many years. Although the technique is somewhat out of favor, PNG allows for smoother, faster interlacing than GIF, JPEG or TIFF formats. Roelofs writes on the official PNG page, that "embedded text in an image is typically readable about twice as fast in a PNG image." [2]

Image editing software can benefit from PNG, particularly as a storage format in the middle stages of editing. For example, if a designer wants to add effects to a color image and then return to it later for cropping, he or she may save it as a PNG. Because PNG is not lossy, the image won't be degraded. It also has 48-bit truecolor and 16-bit grayscale support.

In his "Basic Introduction to PNG Features," Roelofs also points out that PNG's specification "leaves no room for implementers to pick and choose what features they'll support; the result is that a PNG image save in one app is readable in any other PNG-supporting application." [2]

PNG's Limitations

For all its promise, PNG is not the solution for every situation. The biggest obstacle remains browser support. Although since 1997 both Netscape and Internet Explorer have been able to display PNG, they do not support all of its features. Most notably, while PNG offers many levels of transparency, all but Netscape and Explorer's most recent versions have only been able to display binary transparency. Web developers designing for audiences that may use older browsers would be well advised to stick with GIFs and JPEGs as their standard file formats.

It should also be noted that while PNG is capable of replacing GIFs in almost any circumstance, it is not intended as to replace JPEG compression for photographs on the web. JPEG's lossy compression may make the photos of lesser quality than a PNG, but the user will see them much faster.

PNG's do not support animation either, like animated GIFs do. However, a closely related format, Multiple-image Network (MNG), does allow for animation.

The Future

PNG's long-term viability seems all but assured as image-editing applications and browsers continue to find ways to support it. But, as Roelofs points out, "Even free open standards like PNG ... have a huge barrier to climb. It took the "standard" JPEG four years to catch on; it's taken PNG four years to catch on (yes, it's really been that long since the W3C Recommendation); and, barring largish miracles -- e.g. Netscape and Microsoft cooperating -- it will take any other new image format just as long." [1]

Sources

1. "The Story of PNG," Roelofs, Greg, Slashdot, Feb. 25, 1999 (with June 2000 follow-up), www.libpng.org/pub/png/slashpng-1999.html

2. "A Basic Introduction to PNG Features," Roelefs, Greg, www.libpng.org/pub/png/pngintro.html

3. Macromedia Fireworks 2: Using Fireworks, Macromedia Inc., 1999.

4. "PNG (Portable Network Graphics Specification, Version I.: W3C Recommendation 01-October-1996" W3C , Oct. 1, 1996, www.w3.org/TR/REC-png.html

5. "The Current Status of PNG," Roelefs, Greg, www.libpng.org/pub/png/pngstatus.html

6. "PNG Frequently Asked Questions," Roelefs, Greg, www.libpng.org/pub/png/pngfaq.html

7. "History of the Portable Network Graphics (PNG) Format," Roelefs, Greg, www.libpng.org/pub/png/pnghist.html

8. "Macromedia Fireworks FAQ," www.macromedia.com/software/fireworks/productinfo/faq/