[Graphic of Lady Ada]

PNG_IO - An Ada 95 package for input/output of Portable Network Graphics (PNG) files

This is now an obsolete page. If you really want this page, fine, otherwise if you want an up-to-date version, please follow this link.

PNG_IO is an Ada 95 Portable Network Graphics (PNG) coder/decoder. It is designed to provide Ada 95 programmers with direct access to images and graphics stored in PNG format files.

PNG is an image file format supporting greyscale and colour images with and without alpha channels. It is patent-free and offers good levels of lossless compression. The PNG format is defined by the PNG Specification which is available from the PNG website (home page) and various mirrors.

PNG_IO is not intended to serve as an Ada 95 substitute for libpng, the PNG 'C' library, since it provides only high-level reading and writing of images with minimal user-level control. If what you want to do is simply read or write a PNG image from an Ada 95 program, then PNG_IO may be what you want. If you want to do something fancy like display an image progressively as it is read from a remote location, then PNG_IO will not be suitable as it stands.

PNG_IO consists of just over 4000 lines of Ada 95 code, including blank lines and comments. (The source code files contain a standard header of about 40 lines, which is counted once in this total, even though it occurs in every source code file.) There are just over 1800 semicolons (some people regard this as a better indicator than number of lines of code).

Copyright information

PNG_IO is free software released as source code under the GNU General Public License. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

PNG_IO was written by Steve Sangwine while at The University of Reading, UK. He joined the Department of Electronic Systems Engineering, University of Essex, in January 2001 and will continue to maintain and enhance PNG_IO. The University of Reading has agreed to the public release of PNG_IO under the GNU General Public Licence. Enquiries concerning commercial licensing of the software should be directed to Research and Enterprise Services, The University of Reading, Whiteknights, PO Box 217, Reading RG6 6AH, United Kingdom. WWW: http://www.rdg.ac.uk/RES/


PNG_IO is intended to be operating system and machine independent. It depends on (withs) only standard Ada 95 packages.

In order to compile and use PNG_IO, you will need to have the Zlib (home page) compression and decompression library. All applications using PNG_IO must be linked (statically or dynamically) with Zlib. Zlib is freely available as C source code, and as pre-compiled libraries for some operating systems (e.g. Windows 95/98/NT). PNG_IO requires the Zlib_Ada binding to Zlib which is distributed with Zlib version 1.2.1.

PNG_IO is not dependent on libpng.


At present, the user interface does not support passing of whole images as arrays. Support for this may come in a later release, with a generic package which can be instantiated for the user's image array type. (The user will still have to supply functions to construct and deconstruct composite pixels such as RGB and RGB + alpha and greyscale + alpha.)


PNG_IO is distributed as a single zip or gzip compressed tar file. The versions available here are not the latest. Please see the top of this page for a link to the Sourceforge site where you can find later versions.

Filename Size
Distribution zip file (includes manual)png_4_0.zip 142kB
User and Reference Manual pdf iconpng_io_manual.pdf86kB
Distribution zip file (includes manual)png_3_4.zip 123kB
Distribution tar file (includes manual)png_3_4.tar.gz99kB

Dr Steve Sangwine 12 April 2000
Updated 19 May 2000 (PNG home page address)
Updated 17 July 2000 (PNG UK Mirror site address and HTML 4.0 compliance)
Updated 19 July 2000 (Release of version 1.3)
Updated 28 November 2000 (Release of version 2.1)
Updated 24 January 2001 (Moved to new website and manual updated.)
Updated 23 March 2001 (tar.gz distribution added.)
Updated 1 October 2001 (web address amended.)
Updated 7 January 2001 (web address amended, again.)
Updated 23 April 2002 (RSO replaced by RES)
Updated 16 May 2002 (release of version 3.2)
Updated 8 June 2002 (release of version 3.3)
Updated 9 January 2003 (added comment about number of lines of code)
Updated 9 January 2004 (release of version 3.4)
Updated 21 July 2004 (release of version 4.0)
Updated 12 October 2010 (changed comment about version)
Valid HTML 4.0!