Get Started
dotnet add package CoenM.ImageSharp.ImageHash --version 1.3.6
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard | |
| Other |
README
ImageHash
Perceptual image hashing using the ImageSharp library. Includes three hashing algorithms (AverageHash, DifferenceHash, and PerceptualHash). See github for more information.
Calculate image hash
var hashAlgorithm = new AverageHash();
// or one of the other available algorithms:
// var hashAlgorithm = new DifferenceHash();
// var hashAlgorithm = new PerceptualHash();
string filename = "your filename";
using var stream = File.OpenRead(filename);
ulong imageHash = hashAlgorithm.Hash(stream);
Calculate image similarity
Note that to calculate the image similarity, both image hashes should have been calculated using the same hash algorihm.
// calculate the two image hashes
ulong hash1 = hashAlgorithm.Hash(imageStream1);
ulong hash2 = hashAlgorithm.Hash(imageStream2);
double percentageImageSimilarity = CompareHash.Similarity(hash1, hash2);
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 7 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.