I agree with the kudos, but back when I was an interesting person and in early 2000s I stumbled on this same/similar approach of using K-means clusters with LAB color space for a painting algorithm I was using in my masters project. RGB was not effective.