lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.06k stars 421 forks source link

Request: Function to get palette entries #65

Open KasumiArai opened 6 years ago

KasumiArai commented 6 years ago

Something like lodepng_decode_file(&temp, &tempWidth, &tempHeight, filename, LCT_PALETTE, 8) will properly get the index for each pixel in temp, but I can't find a simple way to get the palette that corresponds to these indices.

It seems the answer is to mirror the body of lodepng_decode_memory and grab the info before the lodepng_state_cleanup which isn't too bad, but a readily available function might help others with indexed musings.