Image file hash

Hi Chris,

I have few questions about the image hashing algorithm in MWorks.

Is hashing based on pixel values or is it done for file (binary data)?
(My guess is that it’s done for pixel values otherwise
hash will depend on the file type for example.)

Also, could you let me know which hashing algorithm is used?

And, if hashing is done for pixel values, would you mind
if I ask a small utility program (command line program would be nice)
that gives me the hash value of a given image file?
I would like to use this “standard” hashing program
when I build a common image library for the lab.

Thanks,
Ha

Hi Ha,

The hash value is the SHA-1 hash of the whole file, not the pixel values. This makes the hashing process fast, simple, and robust, at the cost of generating different hash values for images with identical pixel content but distinct packaging (e.g. two PNGs that differ only in their metadata).

For more info, please see Using the file hash to verify an image stimulus.

Chris