yeah, what dunc said would work
And, I reckon there's probably more efficient ways of doing that. Like, breaking the image up into 16x16 / 32x32 chunks and comparing them sequentially, since the coords have to be the same on each end anyway and all the sprites are multiples of 8 or 16 at least