I am trying to develop a program which would take the snapshot of webpage and will then compare it to an old one and highlight the changes if any.
I am using Selenium- WebDriver for taking snapshots. For image processing and compare, after a bit googling I found jMagick, a Java interface for ImageMagick, which I think would be best fit for my requirement.
But due to lack of proper documentation, I am not able to find anything relevant. If anyone could help me out with any code sample for image comparision that would be really helpful.
Again, the problem is to compare two images and highlight the changes or the differences between the two. Output could be a third image with differences highlighted.
Possible duplicates for this are : this and this . But again, no proper solution could be infer from these.
Please if somebody could throw some light on this or may be some other solution in java that would work out.
If you are fine with doing system calls, you can use pdiff. http://pdiff.sourceforge.net/ The tool has been written to compare rendering engines and will output the differences between two files to a new file. It does not seem to have Java bindings though.
Try this.And dont forget to import im4java or maven
In this link you can find an example of image comparison Class using jMagick. They used compare command line function to handle image comparison.
Code snippet:
https://github.com/techblue/jmagick/blob/master/test/magicktest/MagickTesttools.java
Also, you can find the details of compare function here: http://www.imagemagick.org/Usage/compare/