C function to convert a raw image to png

匿名 (未验证) 提交于 2019-12-03 08:54:24

问题:

Is there any c function that allow me to convert a raw image to a PNG file? Preferably, I don't need to pull in a big library for that.

Thank you.

回答1:

I do not believe so. On the other hand, libpng isn't a huge library.



回答2:

Have you tried the libpng library?

http://www.libpng.org/pub/png/libpng.html



回答3:

I'm not sure what you mean by "raw image", but I've found LodePNG easy to work with. http://members.gamedev.net/lode/projects/LodePNG/ There's an example showing you how to encode some raw data to a png



回答4:

See a related question: Convert bitmap to PNG in-memory in C++ (win32)

The short answer is that GDI+ can convert a bitmap image to PNG (with some limitations), so if you're on Windows it's an option that's even more minimal than libPNG.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!