“libpng”,将 PNG 文件从灰度转换为 RGB(仅转换为其中一个通道)

发布于 2024-10-09 20:21:29 字数 207 浏览 0 评论 0原文

我有一段源代码,可以读取图像并将其写入 PNG 文件。然而,它只将图像写入灰度,准确地说只是黑白。

现在,我该如何修改它,以便它能够写入 RGB 通道之一(R、G 或 B 都可以)?

是否有关于使用 libpng 进行像素操作的简短教程?

I have a piece of source code that reads and writes images to PNG files. However, it only writes the images as grayscale, precisely just black and white.

Now, how do I modify it such that it would write to one of the channels in RGB (R or G or B is fine)?

Is there a short tutorial about that pixel manipulation with libpng?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

停顿的约定 2024-10-16 20:21:29

它不是一个很小或很好的书面教程,但总是有一些东西:

http ://www.libpng.org/pub/png/libpng-1.2.5-manual.html

It isn't small or nice written tutorial, but always something:

http://www.libpng.org/pub/png/libpng-1.2.5-manual.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文