I'm a beginner in Automation testing and I'm using Java for Selenium WebDriver. I have an HTML5 canvas as a part of web application similar to Paint. Although I was successful in moving an element on the canvas. But now, I want to compare this element(which is an image in pixels) with another image saved on the Hard Drive of my PC. I thought that taking a screenshot of the element on the canvas and then comparing it with another image would be a better idea. But I am not finding enough trustable resources on the Internet through which I can compare those 2 images by taking their screenshots.
So, I want to ask if there is some another better method or any API with the help of which I would be able to compare both of the images?