Home

Awesome

<img src="/src/icon.png" height="30px"> Verify.Phash

Discussions Build status NuGet Status

Extends Verify to allow comparison of documents via Phash.

See Milestones for release notes.

Contains comparers for png, jpg, bmp, and tiff.

NuGet package

https://nuget.org/packages/Verify.Phash/

Usage

Enable:

<!-- snippet: enable -->

<a id='snippet-enable'></a>

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

<sup><a href='/src/Tests/ModuleInit.cs#L5-L11' title='Snippet source file'>snippet source</a> | <a href='#snippet-enable' title='Start of snippet'>anchor</a></sup>

<!-- endSnippet -->

Comparers

Register all comparers

VerifyPhash.RegisterComparer();

Compare Settings

Phash comparison settings can be modified as follows:

<!-- snippet: Settings -->

<a id='snippet-Settings'></a>

[Test]
public Task LocalSettings() =>
    VerifyFile("sample.png")
        .PhashCompareSettings(
            threshold: .8f,
            sigma: 4f,
            gamma: 2f,
            angles: 170);

<sup><a href='/src/Tests/Samples.cs#L27-L38' title='Snippet source file'>snippet source</a> | <a href='#snippet-Settings' title='Start of snippet'>anchor</a></sup>

<!-- endSnippet -->

Icon

Hash Brown designed by Icon Mark from The Noun Project.