简体   繁体   English

如何将像素数组转储为png?

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

I'm on MacOSX. 我在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. 现在,我想将其作为png文件转储出来。 What is the quickest way to do this? 最快的方法是什么?

You should use libpng . 你应该使用libpng I don't have a Mac, so I can't tell you if it's already pre-installed, but it should be! 我没有Mac,所以我不能告诉你它是否已预先安装,但它应该是! :-) :-)

您可以使它成为一个流并将比特流写入图像对象,然后您可以将图像对象保存为PNG。

http://zarb.org/~gc/html/libpng.html < - 惊人的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将jpeg / png转换为Java中的像素数组 - Convert jpeg/png to an array of pixels in java 如何将PNG文件转换为像素矩阵? - How to convert a PNG file in to a matrix of pixels? 如何将每个像素的 colors 作为元数据添加到 png 图像文件? - How to add colors of each pixels as metadata to png image file? 如何不使用image.src或image.onload将png base 64转换为像素阵列? - How to convert png base 64 to pixel array with out using image.src or image.onload? 如何将像素数组存储到二维数组中? - How to store an array of pixels into a 2D array? 如何在 javascript 中将 png 图像的像素的 512x512 高度图数组放大到 2017x2017 像素,以用作虚幻引擎 4 中的高度图? - How do you upscale a 512x512 to 2017x2017 heightmap array of pixels of a png image in javascript for use as a heightmap in Unreal Engine 4? 如何写出PNG-8888而不是PNG-8881? - How to write out a PNG-8888 instead of an PNG-8881? 如何将PNG图像转换为Array? - How to convert PNG image to Array? 从Android位图获取像素时,如何将像素放置在int []像素数组中? - How are the pixels placed in an int[] array of pixels when getting pixels from a Android Bitmap? 从PNG图像的像素的lsb获取字符串 - Get string from lsb of pixels of a PNG image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM