Fastest PNG decoder for .NET designed to be blazingly fast and memory efficient.
It is focused on decoding 8-bit-per-channel images to little-endian BGRA format (like VK_FORMAT_B8G8R8A8_SRGB or SDL_PIXELFORMAT_ARGB8888).
| Project | Speed | Memory efficiency | Free license |
|---|---|---|---|
| GreenPng | ⚡ | 🟢 | ✅ |
| StbImageSharp | 💡 | 🟡 | ✅ |
| Magick.NET | ❄️ | 🟡 | ✅ |
| SixLabors.ImageSharp | 💡 | 🟡 | ❌ |
| Type | 1, 2, 4 bit | 8 bit | 16 bit |
|---|---|---|---|
| Greyscale | ✅ | ✅ | ❌ |
| Truecolor | ✅ | ❌ | |
| Indexed | ✅ | ✅ | ❌ |
| Indexed (with transparency) | ✅ | ✅ | ❌ |
| Greyscale with alpha | ✅ | ❌ | |
| Truecolor with alpha | ✅ | ❌ |
dotnet add package GreenPngbyte[] image = PngDecoder.Decode(pngFileData, out PngHeader header);
int width = header.Width;
int height = header.Height;bool ok = PngDecoder.TryDecodeHeader(pngFileData, out PngHeader header);
ok = PngDecoder.IsHeaderSupported(header);
byte[] image = new byte[header.ByteSize];
ok = PngDecoder.TryDecode(pngFileData, header, image);- Interlacing
- 16 bit
- Unusual chunks
- War
This is workspace of Git Workspace paradigm.
Main component: GreenPng
Components: