If the input image is lossless (gif, png, tga, bmp…) then you can just pull out the pixels and compare em. Once you found a pixel pair which doesn’t match you can stop - the tile is different.
Getting the pixel data can be either done with a PixelGrabber, with (BufferedImage’s) getRaster or with (BufferedImage’s) getRGB.
Keep in mind that you don’t need to check tile B with A if you already checked A with B (similar to collisions).
Eg if there are 4 tiles you need to check:
A vs B, C, D
B vs C, D
C vs D
I think I would do it with getRGB, simply because it’s… heh… simple and because usually the tiles doesn’t match and the loop can be exited at the very begining.