download the image using this
http://www.software-testing-tutorials-automation.com/2015/01/download-and-save-image-using-selenium.html
this is the much easier way to extract the image
http://stackoverflow.com/questions/6813704/how-to-download-an-image-using-selenium-any-version
compare images using these resources
http://stackoverflow.com/questions/8567905/how-to-compare-images-for-similarity-using-java
http://stackoverflow.com/questions/21179019/how-to-compare-set-of-images-in-java-using-pixel-based-image-comparision-metric
https://rosettacode.org/wiki/Percentage_difference_between_images#Java