Awesome
<img src="/src/icon.png" height="30px"> Verify.ImageSharp.Compare
Extends Verify to allow comparison of images via Codeuctivity.ImageSharp.Compare.
Contains comparers for png, jpg, and bmp.
See Milestones for release notes.
NuGet package
https://nuget.org/packages/Verify.ImageSharp.Compare/
Usage
<!-- snippet: enable --><a id='snippet-enable'></a>
[ModuleInitializer]
public static void Init() =>
VerifyImageSharpCompare.Initialize();
<sup><a href='/src/Tests/ModuleInitializer.cs#L3-L9' title='Snippet source file'>snippet source</a> | <a href='#snippet-enable' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->Image Comparers
The following will use ImageHash to compare the images instead of the default DifferenceHash algorithm.
<!-- snippet: CompareImage --><a id='snippet-CompareImage'></a>
[Test]
public Task CompareImage() =>
VerifyFile("sample.jpg");
<sup><a href='/src/Tests/Samples.cs#L4-L10' title='Snippet source file'>snippet source</a> | <a href='#snippet-CompareImage' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->Register all comparers
All comparers can be registered:
VerifyImageSharpCompare.RegisterComparers();
Icon
Pattern designed by Marialuisa Iborra from The Noun Project.