Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找如何在 C 中使用 libpng 调整图像大小的建议。我已经编写了一个函数,它可以从结构中生成 png 图像。我想让我的图像更大:例如 1 像素扩展到 9 像素 (3x3)。有没有什么功能可以做到这一点?
不,libpng 是一个处理读取和写入 PNG 图像格式的 I/O 库。
调整图像大小与任何磁盘文件格式无关,它是一种纯图像操作,通常发生在内存中。
你应该看看一些通用的图像处理库,或者自己做。您提到的特定调整大小很容易,只需读取一个像素并将其写入输出 9 次。然后使用 libpng 的函数保存新图像。