Having Trouble Displaying "PNG" Files?

If you're getting a little x-in-a-box error when you try to display a graph or chart on this site, and just want a fix without knowing why, click here.

Graphics (pictures, graphs, icons, etc.) on the web are usually stored in one of three file formats, which are reflected in their filename extensions: GIF, JPG (sometimes "JPEG"), or PNG.

The JPG file format is best suited for photos and is universally supported by web browsers that support graphics at all. If you have trouble displaying a picture with a ".jpg" extension, there's probably something wrong with the image itself, or with the web site's configuration. The JPG format is really good for photos, but not so hot for icons, graphs, and other "graphics arts" style images.

The GIF file format does a good job on these images, but it has some technical limitations, as well as a surprising legal one: The GIF technology is patented by Unisys, and that company has made threatening noises about requiring those who write programs to create GIF files to pay a royalty (I don't know that they've actually sued anyone, though). The basic GIF patent expired on June 30, 2003, but there are follow-on patents that may tie the technology up for another 20 years or so.

Although Unisys' threats are directed at the developers of graphics software rather than users of that software, this issue has caused many people who are interested in free software (including me) to avoid the use of GIF files.

The increasingly popular alternative to GIF is the Portable Network Graphics, or PNG, format. PNG image files have all the technical advantages of GIF, plus several more (including support for more colors). And, the PNG format does not infringe the Unisys patents.

All common web browsers have, for at least their last couple of releases, supported PNG format images. However, Microsoft's Internet Explorer seems to have special challenges in dealing with PNG files. Although most IE5 or IE6 installations will display most PNG files OK, it seems that IE sometimes randomly decides not to display these images.


The PNG Fix

If your Internet Explorer installation decides not to display PNG files, here is a suggestion that usually fixes the problem.

In Win98 or WinME, go to the Start menu, click "Run", and then enter:

regsvr32 c:\windows\system\pngfilt.dll

and click OK.

Under Windows 2000 and probably Windows XP, you use a slightly different version of the same command in the "Run Command" box:

regsvr32 c:\WINNT\system32\pngfilt.dll

and click OK.

I claim no credit whatsoever for this fix; I got it from www.libpng.org/pub/png/pngfaq.html. That page also has a few other hints you might want to try if this doesn't work.