Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using libpng in C#

if you want to save the image in PNG format you can use ImageFormat class of .Net. But this class doesn't implemented compression for PNG files. And for some reasons i can't save my file in JPEG format. After Some researched i know libpng is the official PNG reference library. But i can't find anything for using it in .net framework. Does anyone know about this library and using it in .NET?

About libpng

Thanks in Advanced.


1 Answers

ImageMagick is a very nice library that allows you (among other things) create PNG files. Magick.NET is the .Net wrapper for this library. Using this library, you can simply convert/create image formats. E.g. from their documentation:

using (MagickImage image = new MagickImage("Snakeware.gif"))
{
   image.Write("Snakeware.jpg");
}
like image 133
dsfgsho Avatar answered Jun 17 '26 20:06

dsfgsho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!