Nullean.Snapshots.Images 0.12.1

dotnet add package Nullean.Snapshots.Images --version 0.12.1
                    
NuGet\Install-Package Nullean.Snapshots.Images -Version 0.12.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="Nullean.Snapshots.Images" Version="0.12.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nullean.Snapshots.Images" Version="0.12.1" />
                    
Directory.Packages.props
<PackageReference Include="Nullean.Snapshots.Images" />
                    
Project file
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 Nullean.Snapshots.Images --version 0.12.1
                    
#r "nuget: Nullean.Snapshots.Images, 0.12.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 Nullean.Snapshots.Images@0.12.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=Nullean.Snapshots.Images&version=0.12.1
                    
Install as a Cake Addin
#tool nuget:?package=Nullean.Snapshots.Images&version=0.12.1
                    
Install as a Cake Tool

Nullean.Snapshots.Images

snapshots.

PNG image snapshots for Nullean.Snapshots: decoded with its own PNG codec and compared pixel by pixel, perceptually and with anti-aliasing left out, so a screenshot passes on every machine. On a mismatch it writes a diff image.

NuGet

Install

dotnet add package Nullean.Snapshots.Images

Quick start

This package holds the format, the PNG codec and the comparison, with no AwesomeAssertions, so the browser package and the native snap tool can compare screenshots. In tests, use Nullean.Snapshots.Images.Assertions (png.Should().MatchImageSnapshot()). Used on its own:

using System.Runtime.CompilerServices;
using Nullean.Snapshots;
using Nullean.Snapshots.Images;

public static class ImageChecks
{
	// The format on its own, without AwesomeAssertions: how the browser package and snap compare screenshots.
	public static void MatchPng(byte[] png, [CallerFilePath] string file = "", [CallerMemberName] string member = "", [CallerLineNumber] int line = 0)
	{
		var format = new ImageSnapshotFormat(new ImageSnapshotOptions { MaxDifferentRatio = 0.001, OutlineRegions = true });
		var result = Snapshot.Match(png, format, new SnapshotCallSite(file, member, line));
		if (!result.Passed)
			throw new InvalidOperationException(result.FailureMessage); // a .received-diff.png sits next to the received image
	}
}

A diff image: the verified screenshot faded to grey, the changed heading in red, outlined in blue

The diff image is the verified image faded to grey, with differing pixels in red and anti-aliasing in yellow; OutlineRegions draws a blue box around each changed region.

  • Pixels, not bytes. Metadata chunks, encoders and compression levels never fail a test.
  • Differences as people see them. A pixel differs when its YIQ distance exceeds Threshold (default 0.1).
  • Anti-aliasing left out, unless IncludeAntiAliasing is set. MaxDifferentPixels and MaxDifferentRatio allow some noise.

Learn more

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Nullean.Snapshots.Images:

Package Downloads
Nullean.Snapshots.Browser

Browser journeys for Nullean.Snapshots: run agent-browser style journeys with Nullean.Cdp and compare their transcripts, accessibility trees and reads, as trees.

Nullean.Snapshots.Images.Assertions

AwesomeAssertions extensions for Nullean.Snapshots.Images: MatchImageSnapshot for PNG bytes and streams.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.12.1 0 11/12/2026
0.12.0 0 11/12/2026
0.11.0 12 11/11/2026
0.10.1 54 11/11/2026
0.10.0 77 11/11/2026
0.9.0 46 11/11/2026
0.8.1 38 11/11/2026
0.8.0 45 11/11/2026
0.7.0 56 11/10/2026
0.6.0 86 11/5/2026
0.5.0 76 11/5/2026
0.4.0 77 11/5/2026
0.3.0 77 11/4/2026
0.2.0 89 11/3/2026