开发者

How to dump out an array of pixels as a png?

开发者 https://www.devze.com 2022-12-19 03:21 出处:网络
I\'m on MacOSX. I have read out an image, as char image[WIDTH][HEIGHT][3]开发者_JS百科; // row, col, rgb value

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

精彩评论

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

关注公众号