sharp-phash icon indicating copy to clipboard operation
sharp-phash copied to clipboard

Configurable SAMPLE_SIZE / LOW_SIZE

Open kachkaev opened this issue 2 years ago • 1 comments

👋 again @btd! I’m curious if these params could be made configurable:

https://github.com/btd/sharp-phash/blob/623d7fb574f3aa216513065d78c88a93a08354fd/index.js#L5

https://github.com/btd/sharp-phash/blob/623d7fb574f3aa216513065d78c88a93a08354fd/index.js#L51

This is an open question: technically, they can come as a third param of phash function (after sharp options), but I’m not sure if there is any value in this. I am still experimenting with perceptual hashes, so am trying to understand if changing sample sizing can improve the result.

Thanks a lot for putting this library together!

kachkaev avatar May 27 '23 19:05 kachkaev

Hi, this parameters mostly was copied from original implementation. I made it sure that results of this lib match to libphash. In theory parameters could improve hash, but it very depends on the images you are dealing. If it is random images, defaults should be ok.

btd avatar Jun 10 '23 14:06 btd