PNGDIB is a C library that makes it easy to convert between DIB (or BMP) images and PNG images.
Sample programs are included which convert between BMP image files and PNG image files. Also included is a simple PNG viewer.
The API for version 3.x is very different from the one in previous versions. The new API is intended to make it easier to add new features.
View the readme file for details.
Download: pngdib-3.0.1.zip (6 Mar 2003; 120 KB)
Requires libpng
(version 1.2.2beta5 or higher recommended)
and
zlib
(version 1.1.4 or higher recommended).
For an image viewer based in part on PNGDIB, try Purpleview.
Version 2.2.0 has a memory-freeing bug in the write_dib_to_png() function (fixed in 2.2.2), and should not be used if you use that function.
Version 1.0.0 and earlier have a bug that prevents PNG files with 2 bits-per-pixel from being converted correctly. This has been fixed in version 1.1.0.
This code has not been rigorously tested, and may have some bugs. Use at your own risk. If you do find a bug, please report it.
PNGDIB is for Windows (Win32) only. It could be ported to other platforms if you really wanted it, but it would take a bit of effort (also, a decompression algorithm would need to be added if you want to support reading compressed DIBs).
There's some other imaging utilities at my home page.