How can I generate a palette of prominent colors from an image?

后端 未结 6 2139
被撕碎了的回忆
被撕碎了的回忆 2020-12-23 14:57

I\'m trying to figure out how to sample all of the pixels in an image and generate a palette of colors from it, something like this or this. I have no idea where to even beg

6条回答
  •  一整个雨季
    2020-12-23 15:33

    The K-Means clustering algorithm works well for this problem. It does a great job of extracting centroids of image color clusters, but be aware that its non-deterministic behavior makes determining the actual prominence of each cluster difficult.

提交回复
热议问题