How to dump out an array of pixels as a png?
I'm on MacOSX.
I have read out an image, as
char image[WIDTH][HEIGHT][3]开发者_JS百科; // row, col, rgb value
Now, I want to dump it out as a png file. What is the quickest way to do this?
You should use libpng. I don't have a Mac, so I can't tell you if it's already pre-installed, but it should be! :-)
You could make it a bit stream and write the bitstream to an image object and then you can save the image object as a PNG.
http://zarb.org/~gc/html/libpng.html <-- amazing tutorial.
精彩评论