|
LodePNG is a PNG image decoder and encoder, all in one, no dependency or linkage to zlib or libpng required. It's made for C (ISO C90), and has a C++ wrapper with a more convenient interface on top. See lodepng.h for documentation.
|
|
LodeZlib is included in LodePNG and can be used to compress and decompress arbitrary files. Here too, both a C version, and a C++ wrapper, are available. |
|
There is also picoPNG, which is only the decoder part of LodePNG, wrapped in 1 function using local classes and with all bells and whistles removed so that it's only less than 500 lines of code. This is useful because it can easily be plugged into any C++ source file of small programs that don't want to have more .cpp files nor external dependencies.
PicoPNG is available only for C++, not for C.
The function, decodePNG, converts any PNG file data, with any colortype or interlace mode, into a 32-bit image in an std::vector at the output. picopng.cpp |
|
8 little examples in 1 file
lodepng_examples.c
lodepng_examples.cpp |
|
PngSuite tester (C++)
This tests a PNG decoder on most of the images from the official PngSuite
testsuite.cpp
|
Translucent border generator (C++)
This gives a PNG a translucent border that can look good on webpages
border.cpp
For example, it turns the image on the left into the image on the right. In IE6 the image on the right will have a non-white background color (this color can be chosen with the program), in other browsers it's the color of this page.
|
| Lutger Blijdestijn made a port of LodePNG to the D programming language. It can be found here (direct link doesn't work): http://lutger.ifastnet.com/lodepng/lpng07082007.zip |
|