"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

August 07, 2022

ImageHash package - simplify hash

Python library to hash by different methods. Useful to build indexes / similarity search.

The different hashing techniques are

  • Average hashing  - crushes the image into a grayscale 8x8 image and sets the 64 bits in the hash based on whether the pixel's value is greater than the average color for the image.
  • Perceptual hashing - use a discrete cosine transform (DCT) and compares based on frequencies rather than color values
  • Difference hashing - gradient hash, calculate the difference for each of the pixel and compares the difference with the average differences.
  • Wavelet hashing - works in the frequency domain as pHash but it uses DWT instead of DCT.
  • HSV color hashing (colorhash)
  • Crop-resistant hashing

Ref - Link1, Link2


Ref - Link

Package Installation




File Upload



Create Hash Methods



Depending on usecases need to evaluate which suits the need or a combination of techniques.

Keep Exploring!!!






No comments: