BigGustave 1.0.6

Install-Package BigGustave -Version 1.0.6
dotnet add package BigGustave --version 1.0.6
<PackageReference Include="BigGustave" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BigGustave --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BigGustave, 1.0.6"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BigGustave as a Cake Addin
#addin nuget:?package=BigGustave&version=1.0.6

// Install BigGustave as a Cake Tool
#tool nuget:?package=BigGustave&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Open, read and create PNG images in fully managed C#.


To open a PNG image from file and get some pixel values:

using (var stream = File.OpenRead(@"C:\my\file\path\file.png"))
    Png image = Png.Open(stream);

    Pixel pixel = image.GetPixel(image.Width - 1, image.Height - 1);

    int pixelRedAverage = 0;

    pixelRedAverage += pixel.R;

    pixel = image.GetPixel(0, 0);

    pixelRedAverage += pixel.R;

    Console.WriteLine(pixelRedAverage / 2.0);

The PNG object has methods to inspect the header and get the pixel values. The header has properties for:


The PNG also has width and height as convenience properties from the header information:

png.Width == png.Header.Width
png.Height == png.Header.Height

And a property that indicates if the image uses transparency:


To get a pixel use:

Pixel pixel = png.GetPixel(0, 7);

Where the first argument is x (column) and the second is y (row). The Pixel is used for all image types, e.g. Grayscale, Colour, with/without transparency.


To create a PNG use:

var builder = PngBuilder.Create(2, 2, false);

var red = new Pixel(255, 0, 0);

builder.SetPixel(red, 0, 0);
builder.SetPixel(255, 120, 16, 1, 1);

using (var memory = new MemoryStream())

    return memory.ToArray();

You can also load a PNG into a builder which will copy all the pixel values into the builder for easy editing:

var png = Png.Create(@"C:\files\my.png");
var builder = PngBuilder.FromPng(png);
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 617 5/1/2021
1.0.5 126 4/22/2021
1.0.3 401 12/31/2020
1.0.2 211 11/8/2020
1.0.1 400 12/17/2019
1.0.0 369 5/19/2019