Get dominant colors from image discarding the background

后端 未结 4 915
盖世英雄少女心
盖世英雄少女心 2021-02-02 02:42

What is the best (result, not performance) algorithm to fetch dominant colors from an image. The algorithm should discard the background of the image.

I know I can build

4条回答
  •  暖寄归人
    2021-02-02 03:23

    Isolating the foreground from the background is beyond the scope of this particular answer, but...

    I've found that applying a pixelation filter to an image will draw out a really good set of 'average' colours.

    Before

    http://img12.imageshack.us/img12/825/pixelate1a.jpg

    After

    http://img12.imageshack.us/img12/8127/pixelate2.jpg

    I sometimes use this approach to derive a pallete of colours with a particular mood. I first find a photograph with the general tones I'm after, pixelate and then sample from the resulting image.

    (Thanks to this page for the images found via Google Image Search)

提交回复
热议问题