csharp
public static class ImageComparerComparing a rendering against its reference, and saying usefully what changed.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ Counting pixels over a threshold, not a mean-squared error. MSE is the obvious metric and the wrong one: a value low enough to pass a whole image hides a bright artefact in a corner, which is exactly the failure a picture suite exists to catch. Counting pixels that exceed a per-channel threshold catches the small-and-wrong case, and reporting the worst pixel with its coordinates says where to look.
Methods (2)
public static ImageComparison Compare(in Bitmap rendered, in Bitmap expected, ImageTolerance tolerance)Compares two pictures.
public static Bitmap Diff(in Bitmap rendered, in Bitmap expected, ImageTolerance tolerance)The differing pixels in red, over a dimmed copy of the reference.
Used by (2)
- RasterizerTestsVixen.Ui.Testing.Tests
- VisualBaselineVixen.Ui.Testing