Skip to content

Instantly share code, notes, and snippets.

@conholdate-com-kb
Created September 2, 2022 10:32
How to Compare Images in C#. For more information, please follow link: https://kb.conholdate.com/total/net/how-to-compare-images-in-csharp
using System;
using GroupDocs.Comparison;
namespace CompareImagesInCSharp
{
class Program
{
public static void Main(string[] args) // Main function to compare Images using C#
{
// Remove the watermark in output Image document by adding license
string licensePath = "/path/to/GroupDocs.Comparison.lic";
GroupDocs.Comparison.License lic = new GroupDocs.Comparison.License();
lic.SetLicense(licensePath);
using (Comparer comparer = new Comparer("/path/to/source.png"))
{
comparer.Add("/path/to/target.png");
comparer.Compare("/path/to/compare-result.png");
}
Console.WriteLine("Done");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment