rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

Can we get original image from signature? #104

Closed NickYadance closed 5 years ago

NickYadance commented 5 years ago

Say someone gets the signature of a picture , it that possible that he get the original image by processing the signature???

vrde commented 5 years ago

@NickYadance short answser: no.

Even if it's not possible to reconstruct the original image, the image signature does not have the same properties of a hash function. The image signature contains information like: "this area is brighter than this other area", so there is some information leakage.

Think of the image signature as a really really downsampled (pixellated), black and white version of the original image.

The code that downsamples the image uses, by default, a 9×9 grid. This value can be customized tho. Here is the documentation:

https://github.com/EdjoLabs/image-match/blob/33682eb3c1217e2f81fa689a0e9af1d4910db45a/image_match/goldberg.py#L34-L45

NickYadance commented 5 years ago

@vrde thank u for ur answer. got it now