The PNG Guide is an eBook based on Greg Roelofs' book, originally published by O'Reilly.

``Standard'' Servers

The first requirement for a web server to support PNG properly is to enable the correct MIME type, image/png. On most servers, including CERN/W3C (, NCSA (, Apache (, Zeus ( and various flavors of Netscape servers (, this can be accomplished most easily by editing the mime.types file to include one of the following two lines:

image/png png


type=image/png exts=png

The latter format is used by Netscape servers, but for any server, the correct format should be obvious from the other entries in the file (search for the image/gif or image/jpeg lines and use one of them as a template). Apache can also be configured via its srm.conf file (or, if AllowOverride FileInfo has been specified, in .htaccess files in individual directories) with the following line:

AddType image/png png

Note that the original PNG media type, image/x-png, has been obsolete since image/png was officially registered in October 1996. If the older type is present in either configuration file, change it to image/png or delete it altogether.

Once a change to the configuration files has been made, the server will need to be signaled to reread them. For some Unix servers, this can be done via the kill -HUP command, but restarting the server is a more portable method. Check the server's documentation for the recommended approach.

Last Update: 2010-Nov-26