Edit: Looking at the code more closely it looks like you were using Lab at one point but commented it out[3], so I'm guessing you're already aware of this.
1: https://stackoverflow.com/a/9019461/185171
2: https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB
3: https://github.com/worldveil/photomosaic/blob/bb720efda11383...
But you’re correct, generally that’s the space you want to be in.
I've done some similar work[1], but issue with L*ab color is it's terrifically slow to calculate diff, at least in JS.
Basically what this will do is assign each tile less than 100% of the time randomly and then for each that isn’t, you choose among the top best K matches on L2 distance with equal probability. Gives it a little bit of both.
We’ve been creating these mosaics for decades...
But yes the photomosiacs strictly don’t use ML, unless you count the internal fun stuff Faiss (the similarity search lib) does to construct fast indexes.
[1] https://github.com/worldveil/photomosaic/blob/master/emosaic...
As I mentioned above the only ML is the face classifier. There’s a flag that allows you to only include face pics in the photomosaics as well