Table of Contents

Enum AlphaCompare

Namespace
Egami.Analysis
Assembly
Egami.dll
public enum AlphaCompare

Fields

Premultiplied = 0

Colors are multiplied by their alpha before they are compared, so two fully transparent pixels are equal whatever color is stored under them: what a viewer sees. ImageMagick 7's compare works this way too.

Straight = 1

The stored channels are compared as they are, so a different color under a transparent pixel counts.

Examples

// Every cheap metric in one pass, per channel and overall, on the 0 to 1 scale; SSIM on request.
CompareResult result = Raster.Compare(expected, actual, new CompareOptions { Ssim = true, Fuzz = 0.02f });
Console.WriteLine($"PSNR {result.Overall.Psnr:F1} dB, SSIM {result.Overall.Ssim:F4}, {result.DifferentPixels} pixels off by more than 2%");
bool sameLook = result.Overall.Psnr >= 40;