I'm not quite sure what you're getting at, but generating a checksum of a file (image or otherwise) would involve calculating the sum of all bytes in that file. If you do that for two files, chances are good that the files will be identical if the checksums are identical. Wikipedia has
more to say on the subject.