As a starting point, consider clustering the colors of your image. If you do not know how many clusters you want, then you will need methods to determine whether to combine or not use the two specified clusters. For now, suppose we know this number. For example, given the following image on the left, I matched its colors with three clusters that have medium colors, as shown in the middle, and representing each cluster with its middle color gives the image on the right.



, . , ( ) - , , . () , "" . . , "" , . , 3x5. ( - ).

, , , . , , k- RGB . , , .