Graphics and the Internet
The PNG format (Portable Network Graphic, pronounced PING) has often been touted as a replacement for GIFs, but so far it doesn’t seem to have taken off. This month we’re going to find out a bit more about it.
GIFs are lossless so you won’t lose any image quality, but they only support up to 256 colors. JPEGs support millions of colors, but they are lossy and aren’t particularly good at rendering text. File sizes are significantly reduced by JPEG compression, but the resulting quality can be poor.
As you can see, both image formats have their limitations. PNG gives us an alternative.
One problem with GIF is that it is not an open format, meaning that if you plan to write some GIF creation software you’ll be required to obtain a licence from Unysis. That may be okay for big companies like Adobe, but not so fun for freeware and shareware programmers.
In 1994 Unysis started actively chasing up these licenses. As you can imagine, the Internet community was annoyed, so a group of enthusiasts led by Thomas Boutell put together plans for a better, free, lossless graphic format to replace the GIF: PNG.
I feel that the following are the major features of the PNG file format.
While GIF only supports 256 colors, PNG supports ‘truecolor’ images.
GIF lets you choose to make a certain color transparent so everything underneath shows through. However, if you have a shadow edge (for example) on an image, unless you know the background color, the resulting image will look odd. PNG supports alpha-channel transparency so that regardless of the background the image is placed over, it looks fine. This is better explained in the example below.
As you can see, the shadow area on the GIF image doesn’t look as good as the PNG.
PNG boasts file sizes up to 25% smaller than GIF.
That sounds a bit scary, doesn’t it? Well, it’s not as bad as it sounds. Images created on a Mac generally look darker on a PC, and PC-created images look paler on a Mac. This is because different computer systems and monitors interpret color values differently. Gamma correction makes allowances for these differences. PNG supports gamma correction, so a PNG image should look almost identical on all major platforms.
Unlike GIFs, the PNG format doesn’t support animation—which, believe me, is a good thing!
So Why Hasn’t PNG Taken Off?
While PNG has been accepted by the World Wide Web Consortium (W3C), and most image editors (such as Photoshop, CorelPaint, and GraphicConverter) can write PNGs, browsers have been slow to accept the format and to implement support for all of PNG’s features. This is happening gradually; if you want to use PNG images, try them out on a few non-essential images on the site and see what visitor feedback you get.
Netscape (Mac & PC) from version 4 and Internet Explorer from version 4 (PC) and version 5 (Mac) all support the PNG format, although they don’t yet fully support all of its features. iCab supports PNG very well, but doesn’t support some features like gamma correction. To see if your browser supports PNG visit this page. The image is quite large, which gives you the opportunity to see PNG’s interlacing as it downloads.
One of the other reasons PNG hasn’t taken off is ignorance. Whenever you read an Internet graphics tutorial, all you read about is GIF this and JPEG that. PNG rarely gets a mention. It would be good if PNG took, but history has shown that the stronger product doesn’t necessarily win the market.
• • •
Although this column has covered just the basics of PNG, you can learn more at the PNG Web site. If there is enough interest, I may return to PNG in a future column.
Happy holidays, everyone!
Also in This Series
- PNG · December 2000
- Seven New Deadly Internet Graphic Sins · November 2000
- Seven Deadly Internet Graphic Sins…or Things That Look Really Bad on Web Pages · October 2000
- The Animated GIF · September 2000
- The GIF File Format · August 2000
- Banner Advertisements · July 2000
- JPEGs and JPEG Compression · June 2000
- Help, I Can’t Draw! · May 2000
- Copyright · April 2000
- Complete Archive