Skip to content

Instantly share code, notes, and snippets.

@conholdate-com-kb
Created September 15, 2022 09:29
How to Compare Images in Java. For more information, please follow link: https://kb.conholdate.com/total/java/how-to-compare-images-in-java
import com.groupdocs.comparison.Comparer;
import com.groupdocs.comparison.license.License;
import java.nio.file.Path;
public class CompareImagesInJava {
public static void main(String[] args) { // Main function to compare Images in Java
// Remove the watermark in output PDF document by adding license
License lic = new License();
lic.setLicense("/path/to/GroupDocs.Comparison.lic");
try (Comparer comparer = new Comparer("/path/to/source.png")) {
comparer.add("/path/to/target.png");
final Path resultPath = comparer.compare("/path/to/result.pdf");
}
System.out.println("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment