GreenPng 2.2.1
dotnet add package GreenPng --version 2.2.1
NuGet\Install-Package GreenPng -Version 2.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GreenPng" Version="2.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GreenPng" Version="2.2.1" />
<PackageReference Include="GreenPng" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GreenPng --version 2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GreenPng, 2.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GreenPng@2.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GreenPng&version=2.2.1
#tool nuget:?package=GreenPng&version=2.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | ⚡ | :green_circle: | ✅ |
| StbImageSharp | 💡 | :yellow_circle: | ✅ |
| Magick.NET | ❄️ | :yellow_circle: | ✅ |
| SixLabors.ImageSharp | 💡 | :yellow_circle: | ❌ |
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
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.<br> Main component: GreenPng<br> Components:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- GreenBuf (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.