[PNG] Portable Network Graphics


The PNG graphics format was defined during 1995-96 to overcome the problems with the copyright issues of GIF. The compression of PNG (where all the copyright issues started with) is based on the zlib algorithms from Mark Adler e.o., which is free software donated to the public domain.

PNG is a loss-less format and doesn't compete with JPEG. The latter is perfect to store scanned or photographic images. PNG on the other hand is superior for computer generated images, be it from CAD packages or from rendering software. Besides the goal to create a public domain format, at the same time the oportunity was taken to make it into a better standard then GIF. This has resulted into a number of important features:

grayscale 1-bits paletted 2-bits full-color 8-bits black & white, paletted and full color formats
paletted 4-bits grayscale 16-bits full-color 16-bits from 1 upto 16 bit per color
gray with alpha channel rgb with alpha channel with transparency mask alpha channel or transparency maps for overlapping images
paletted file-gamma = 1.0 grayscale file-gamma = 0.55 full-color file-gamma = 0.45 gamma indication for image portability over various platforms
with chroma values image filtering date and text chunks chroma, text and date chunks to store additional information

The full list of goodies in PNG is much longer, but this gives a taste. For further info on PNG, including the formal specification, the libraries available for reading or writing PNG images and an overview of the applications available, the PNG Home Page is the place to visit.


[Adam7 interlacing demo] PNG is using a two-dimensional interlacing algorithm that is superior to the interlacing used in GIF89a images. This algorithm, named Adam7 after it's inventor, uses seven passes to send the complete picture. In the first pass only 1 out of 64 pixels is transmitted, which results in a very quick impression what the image will look like.
For a demonstration of Adam7 interlacing and a comparison with the algorithm in use by GIF, click here or on the button on the left.


[authors] The PNG specification was written by a group of people from all around the world. And as good cyber-folks fits, not only from various countries but even more from very various backgrounds. That this has resulted in such a homogeneous standard is a miracle. Have a look why this is called "a wild bunch".


[pnmtopng] My own role in the PNG creation has only been in a few areas. For starters Alex Lehmann and I developed together the pnmtopng tools. These are two programs to translate from and into the pbm-formats as part of PBMplus and netpbm. Over the years pnmtopng and pngtopnm have proven to be very flexible and to produce PNG images with well chosen formats, resulting in a minimal file size.


[pamtopng] Twenty years after pnmtopng it was time for a rewrite. First of all the code had bloated to double the original size. Many contributors, many visions on how the tool should look like. Resulting in very complex code. Also computer power and memory did increase a lot. No need anymore for super optimalized compression. And the ppm file format had evolved into pam, which includes an alpha channel. The resulting pamtopng is a quarter of the code size, stripped 60% of the command line parameters and does a better job.


[pam2png] A quick and dirty implementation of a converter for NetPBM images that contain an alpha channel. This was developed as an ad interim solution until the upgrade of pnmtopng to pamtopng. This program isn't removed because pam2png doesn't require the netpbm libraries. On my blog more info on this tool.


[pngcsum] Each chunk in a PNG image is verified for corrupted data using a CRC32 checksum. When you modify a PNG image by hand, the data changes and the checksum isn't valid anymore. For that purpose I created this little tool, called pngcsum, that takes such a modified PNG, recalculates the checksums and writes it out to an again valid PNG file.


[pngexif] In 2017 a new chunk got added to PNG to store the EXIF data typically found in JPEG images from digital cameras. Pngexif is a tool to extract the data from a PNG "eXIf" chunk or to insert an "eXIf" chunk into an existing PNG file.


[Alpha-channel demo] One of the big features in which PNG out-performs GIF, is it's capability of storing images that include an alpha-channel. This finally enables proper anti-aliasing and eliminates the (on the web so common) badly colored outlines around images and fonts. Unfortunately the big browsers, allthough supporting PNG, don't handle these images with alpha-channels well. AlphaMix is a Windows-95/NT program that demonstrates how semi-transparent PNG images should be displayed against background images or plain background colors.


[Amaya and Anti-Aliasing] Click here for a small story about A's, A's and A's. More precise about the Amaya browser of W3C, the Alpha-channel feature of PNG and the use of alpha channels for Anti-aliasing of fonts and images. You want to get rid of those wrong colored outlines around your fonts and images? Here is the answer!


[VisualPng] For a long, long time, PNG developments were mainly driven from the Unix world. However, since version 1.0.7 libpng fully supports Visual-C, both with static linking to .lib's and dynamic run-time linking of .dll's. VisualPng is part of the libpng "contrib" distribution and was developed to illustrate how these new libpng features can be used in a normal Win32 project.


[tiff2png] As the name already indicates, tiff2png converts bitmap images from TIFF into PNG. Because many fax-files are saved as .tiff, this program finds good use to convert those faxes to the more web-friendly PNG format. Original reason to develop tiff2png was the lack of conversion possibilities for TIFF files containing alpha channels. Especially on NeXT systems, users create lots of TIFF files that have the rather exceptional 2-bit gray and 4-bit color formats, containing an alpha channel besides the graphics info. When converting these to PNG using tiff2png, the alpha channels are correctly conserved.


[pngsuite] While doing all this software development for PNG, I got a big need for images to test the proper functioning of my programs. After many intermediate steps this has finally resulted into PngSuite, the official set of test images for PNG.


[back home] [Adam7 interlacing demo] [NetPBM Converters for PNG] [Chunk CheckSum Correction] [AlphaMix program for Win32] [Anti-aliasing and Amaya] [Tiff to PNG converter] [PNG Viewer in Win32 Visual-C] [PingPong] [PngSuite]


  Willem van Schaik, Calgary, Jan 2017     http://www.schaik.com/wwwillem.html