I haven't used the PicoPNG version, but LodePNG is fantastic, can also create PNGs, is easy to use and easy to integrate. Like LemonScented says t's not exactly a library, LodePNG like PicoPNG is a single source code file + header so you can just add it to your project. You can use it like this:
LodePNG_Decoder decoder;
LodePNG_Decoder_init(&decoder);
unsigned char* buffer;
unsigned char* image;
size_t buffersize, imagesize;
LodePNG_loadFile(&buffer, &buffersize, filename); /*load the image file with given filename*/
if ( !buffer || buffersize <= 0 ){
printf("Couldn't open file: %s\n", filename);
return;
}
LodePNG_decode(&decoder, &image, &imagesize, buffer, buffersize); /*decode the png*/
int width = decoder.infoPng.width; height = decoder.infoPng.height;
init(width, height);
uint32_t *image2 = (uint32_t *)image;
for(int x = 0; x < decoder.infoPng.width; x++) {
for(int y = 0; y < decoder.infoPng.height; y++) {
uint32_t pixel = htonl(image2[y * decoder.infoPng.width + x]);
// DO WHATEVER HERE
}
}
free(buffer); free(image);