开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜