Awesome
<img src="/src/icon.png" height="30px"> Verify.ImageHash
Extends Verify to allow comparison of images via ImageHash.
See Milestones for release notes.
Contains comparers for png, jpg, and bmp.
NuGet package
https://nuget.org/packages/Verify.ImageHash/
Usage
<!-- snippet: enable --><a id='snippet-enable'></a>
[ModuleInitializer]
public static void Init() =>
VerifyImageHash.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:
VerifyImageHash.RegisterComparers();
Icon
Swirl designed by Philipp Petzka from The Noun Project.