Reputation: 10283
I'm just wondering how I could go about iterating through each pixel of an image? I know I can open the file as I could any other, but it's not in a 'readable' format.
For example, let's say I have: world.png (1920/1080)
How do I go about parsing it within two for loops?
Upvotes: 0
Views: 1830
Reputation: 10162
You should use a library to achieve what you want. In this case the library is libpng
. See the "reading" section of the manual: http://www.libpng.org/pub/png/libpng-manual.txt
As noted by @Ben in the comments there is also a C++ wrapper: http://www.nongnu.org/pngpp/doc/0.2.7/
Upvotes: 1