can also do the colour correction to make the tile more similar to the original piece
the algorithm to choose the most silimar tile
fewer repitations between tiles
example:
how to choose among: all light blue, half white half dark blue, white background with dark blue dots and so on, wich has the same average colour: light blue.
To deal with: