code: def check_image_duplicates(file_list):
      
      master_hash = ''
      ham_dist = 0
      results = []
      print("Checking Images for duplicates (despite resizing, colours, etc) " )
      for ndx, fname in enumerate(file_list):
          #img = Image.open(fname)
          img = load_image(fname)
          hsh = get_img_hash(img)
          if ndx == 0:  # this is the test MASTER image
              master_hash = hsh
          else:
              # compare hamming distance against image 1  
              #print("hash=" + hash + "  MASTER_HASH=" + master_hash)
              ham_dist = hamming_distance(hsh, master_hash)
          #print(hsh + " <- " + fname + " ,  hamming dist to img1 = " + str(ham_dist))
          #results.append(hsh + " <- " + fname + " ,  hamming dist to img1 = " + str(ham_dist))
          results.append({'hsh':hsh, 'fname':fname, 'dist_to_img1':str(ham_dist)})
      return results
docs: Checking Images for duplicates (despite resizing, colours, etc)