I like to compare two images. imagemagic tool does this for me using cmd prompt. it compares two images (for e.g. a button's position is different) and output the result image in new gif image which highlights the difference. However i want some tool which generate the new image like this however only if there is a difference. Please suggest how can i do it using any tool or even if this is possible using selenium with java. imagemagic generate the new result image even if there is no difference between them.
edited: I have done RnD and concluded that the imagemagic + iam4java can be used through selenium to compare the images but still cannot find how to put condition of generating the output image only if there is a difference