HotRS.ImageComparison 1.2.0

dotnet add package HotRS.ImageComparison --version 1.2.0
                    
NuGet\Install-Package HotRS.ImageComparison -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HotRS.ImageComparison" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HotRS.ImageComparison" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="HotRS.ImageComparison" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HotRS.ImageComparison --version 1.2.0
                    
#r "nuget: HotRS.ImageComparison, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HotRS.ImageComparison@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HotRS.ImageComparison&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=HotRS.ImageComparison&version=1.2.0
                    
Install as a Cake Tool

House on the Rock - Image Comparison Utility

This nuget package is primarily an encapsulation of work done here: https://github.com/xnafan/Simple-image-comparison/blob/master/SimpleImageComparisonClassLibrary/SimpleImageComparisonClassLibrary.csproj

I added a few public methods to simplify usage.

https://www.nuget.org/packages/HotRS.ImageComparison/

Installation:

Install using Package Manager (or your preferred tool) PM > NuGet\Install-Package HotRS.ImageComparison

Usage

Generate image metadata:

(These are the constructors)

ImageInfo info = new ImageInfo(filename, gridSize);

ImageInfo info = new ImageInfo(Image, gridSize);

Note on the GridSize parameter:

The generation of the HashCode is dependent upon the "GrayValues" calculated in the constructor. The application samples a NxN grid of pixel values (default is 16x16). For file sets of 10k or less, this is probably acceptable. For larger sets of file, you may run into duplicate hashcodes for pictures that are NOT identical. Increasing the grid size will resolve this issue. The downside of a larger gird size is processing time. On a test machine with 32GB ram and a 4ghz quadcore processor, the average processing time at 16 was about 100 ms/file. With a setting of 32 it jumped to 348ms.

ImageInfo includes:
public byte[,] GrayValues
public override string ToString()
public bool Equals(ImageInfo other)

Does this image equal another.

public override int GetHashCode()

GetHashCode() generates a code unique to the image. These codes can later be matched when looking for duplicates or compared for differences within a percentage (finds similar images).

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 90 8/22/2025
1.0.9 232 1/25/2024
1.0.8 145 1/22/2024
1.0.7 159 1/15/2024
1.0.6 152 1/12/2024
1.0.5 189 1/2/2024
1.0.4 165 12/22/2023
1.0.3 153 12/22/2023
1.0.2 183 12/19/2023
1.0.1 162 12/16/2023
1.0.0 139 12/15/2023