You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment there doesn't appear to be any way to hook into imagehash to remove solid colours from the image - this causes two images with a heavy black border to look similar.
It would be great if there was a way to filter the image before the perceptual hash is generated.
Take for example these two images - notice the black border on either side. This causes the two images to look 76% similar simply due to the black borders.
GD provides a imagecropauto which I believe will auto crop out the black / white borders, maybe this could be used?
The text was updated successfully, but these errors were encountered:
Hi @garygreen
I agree with you - but I am not sure if imagehash should handle this.
If you ask me, it's more an image preprocessing task.
I also faced this issue and I created this helper "remove_constant_colors()".
It will remove all constant colors, all repetitive pixel colors in both vertical and horizontal directions.
By applying this preprocessing task, the image looks like this:
When I compare both images, I get a result of hash difference value of 313 which is very high so different images.
At the moment there doesn't appear to be any way to hook into imagehash to remove solid colours from the image - this causes two images with a heavy black border to look similar.
It would be great if there was a way to filter the image before the perceptual hash is generated.
Take for example these two images - notice the black border on either side. This causes the two images to look 76% similar simply due to the black borders.
GD provides a
imagecropauto
which I believe will auto crop out the black / white borders, maybe this could be used?The text was updated successfully, but these errors were encountered: