I'm trying to figure it out this topic. I viewed all related questions and answers in this platform then I got some ideas how can I do that. (e.g. comparison bytes of images for exact similarity and comparison some random pixels of images, also image hashing.) And also found this repository. In this example I can compare 2 images. It gives a difference. Let's say somehow we can know that two images are whether duplicate, similar or not. What confuses me at this point is: Let's suppose we have 10000 photo in our gallery. Wouldn't the app crash if all the comparisons were made in pairs and we did them for each image? Do you have more performance friendly suggestion about this topic?