FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

VerifyTests/Verify.ImageHash: Extends Verify to allow comparison of images via ImageHash. · GitHub

Repository files navigation

Verify.ImageHash

Extends Verify to allow comparison of images via ImageHash.

See Milestones for release notes.

Contains comparers for png, jpg, and bmp.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Developed using JetBrains IDEs

NuGet

Usage

[ModuleInitializer]
public static void Init() =>
    VerifyImageHash.Initialize();

snippet source | anchor

Image Comparers

The following will use ImageHash to compare the images instead of the default DifferenceHash algorithm.

[Test]
public Task CompareImage() =>
    VerifyFile("sample.jpg");

snippet source | anchor

Register all comparers

All comparers can be registered:

VerifyImageHash.RegisterComparers();

Use specific threshold

[Test]
public Task CompareImageThreshold() =>
    VerifyFile("sample.jpg")
        .UseImageHash(threshold: 85);

snippet source | anchor

Use specific algorithm

[Test]
public Task CompareImageAlgorithm() =>
    VerifyFile("sample.jpg")
        .UseImageHash(algorithm: new PerceptualHash());

snippet source | anchor

Icon

Swirl designed by Philipp Petzka from The Noun Project.

About

Extends Verify to allow comparison of images via ImageHash.

Resources

Code of conduct

Stars

9 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL