No Color Repeat Image
The nearest color search is using an naive bruteforce approach.
However it was optimized for speed a little and tries as little
options as necessary. If you want to know how it works exactly,
feel free to take a look at
Have a good day