PNG libraries for C#
.NET has no built-in cross-platform PNG codec (System.Drawing works only on Windows in .NET 6+). Use:
- ImageSharp: fully managed, no native dependencies, rich PNG options (bit depth, palette, text chunks). Free under the Apache 2.0 license for open source projects and companies under $1M revenue, otherwise needs a commercial license.
- SkiaSharp: MIT-licensed wrapper of Google’s Skia graphics engine, best when you also draw (text, shapes, gradients).
- Magick.NET: ImageMagick for .NET, Apache 2.0, reads and writes over 100 formats and can losslessly optimize PNG files.
- ImageSharp ImageSharp is a fully managed .NET image library. How to read and write PNG files in C#, set compression and color type, get the size without decoding.
- Magick.NET Magick.NET is the .NET wrapper of ImageMagick. How to read and write PNG files in C#, set compression level, optimize PNG losslessly, read text attributes.
- SkiaSharp SkiaSharp is the .NET binding of Google's Skia graphics engine. How to decode and encode PNG files in C#, resize, draw on an image.