Step 1 is to implement a framework that can match pixels to their nearest neighbors. Nearest neighbors in this case is in terms of pixel similarity.
For each pixel, precompute value:
get a grid of neighbor pixels in a specified radius
store color values into 2D array
take the average value
For a selected pixel, its nearest neighbor is found by simply finding the smallest L2 distance between that pixel's average color value and the value of every other pixel that is not itself.
I'll also need to build a Qt interface to load texture images and visualize the nearest neighbor search. We'll see how it goes!