Skip to content

Commit

Permalink
simple fix for colorhash algo
Browse files Browse the repository at this point in the history
  • Loading branch information
saim61 committed Dec 4, 2024
1 parent 07951cd commit d6001f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imagehash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def colorhash(image, binbits=3):
maxvalue = 2**binbits
values = [min(maxvalue - 1, int(frac_black * maxvalue)), min(maxvalue - 1, int(frac_gray * maxvalue))]
for counts in list(h_faint_counts) + list(h_bright_counts):
values.append(min(maxvalue - 1, int(counts * maxvalue * 1. / c)))
values.append(min(maxvalue - 1, int(counts) * maxvalue * 1. / c))
# print(values)
bitarray = []
for v in values:
Expand Down

0 comments on commit d6001f1

Please sign in to comment.