How can I get dominant 5 colors from image using OF?

#1

Hi, All.

How can I get dominant 5 colors from image using OF?

Like thses :

Thanks in advances.
Best,
@bemoregt.

#2

this addon may help

2 Likes
#3

You can get a palette from Opencv using kmeans clustering

https://gist.github.com/vanderlin/f34fac6369fd1e85a10e2920af4b5d05

2 Likes
#4


I think this one don’t builds a palette by default, just one dominant color. but could help in some way maybe

#5

cool @bidul, this fork has this really nice example:

2 Likes
#6

I made another fork based on the stc one.



stc example-weights can sort colors weighted based on their areas, their order is based on their chroma values.
my example-weights2 can sort by Hue, Saturation, Brightness or the above one.
It has a gui too to change the number of colors, the sorting type, etc on the fly.
There’s some image loading from url too.

3 Likes