views:

107

answers:

3

I'm on MacOSX.

I have read out an image, as

char image[WIDTH][HEIGHT][3]; // row, col, rgb value

Now, I want to dump it out as a png file. What is the quickest way to do this?

+1  A: 

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! :-)

Chris Jester-Young
+1  A: 

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.

Jeremy Petzold
Can you give me more details?
anon
A: 

http://zarb.org/~gc/html/libpng.html <-- amazing tutorial.

anon