This is a fast and simple algorithm for comparing the similarity of 2 images. Pure Go and zero dependencies.
- Resize the images to be 8 by 8 pixels. This is done by a very simple resizing algorithm.
- Make the images grayscale.
- Get the bitmask image value threshold. This is done by getting the average gray value in the image.
- Calculate the bitmask of the image, skip all values that are smaller than the threshold.
- Calculate the Hamming distance between two hashes.
- Divide it by the amount of bits in the hash (this library uses uint64 for hashes, so 64).