Skip to content

FireNameFN/GreenPng.Workspace

Repository files navigation

GreenPng

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).

Comparsion

Project Speed Memory efficiency Free license
GreenPng 🟢
StbImageSharp 💡 🟡
Magick.NET ❄️ 🟡
SixLabors.ImageSharp 💡 🟡

Format support

Type 1, 2, 4 bit 8 bit 16 bit
Greyscale
Truecolor
Indexed
Indexed (with transparency)
Greyscale with alpha
Truecolor with alpha

How to use

Installing from NuGet

nuget

dotnet add package GreenPng

Easy use

byte[] image = PngDecoder.Decode(pngFileData, out PngHeader header);

int width = header.Width;
int height = header.Height;

More advanced way

bool ok = PngDecoder.TryDecodeHeader(pngFileData, out PngHeader header);

ok = PngDecoder.IsHeaderSupported(header);

byte[] image = new byte[header.ByteSize];

ok = PngDecoder.TryDecode(pngFileData, header, image);

Not supported

  • Interlacing
  • 16 bit
  • Unusual chunks
  • War

Git Workspace

This is workspace of Git Workspace paradigm.
Main component: GreenPng
Components:

About

Fastest PNG decoder for .NET and C#

Resources

License

Stars

Watchers

Forks

Contributors

Languages