2

I have to load colours value from *.png file in c. Something like imread in matlab. I learned png file construction, tried to open file as binary and write to matrix, but I probably done something wrong. I alao tried to search, but I couldn't find suitable library.

Any advice how can I do that or which library should I use?

mlodziaszka
  • 89
  • 2
  • 10

1 Answers1

4

You're going to need to decompress the zlib compression on the PNG first (if there is any) before you can get to the raw color values. The easiest way to do this is through the free libpng. You will find many examples here and elsewhere on how to do just that.

Community
  • 1
  • 1
greg
  • 4,843
  • 32
  • 47