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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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