Forum

VL.ColorThief

bonjour there,

made small VL wrapper around the ColorThief library that allows to get color palettes and dominant color out of an SKImage

image

To install, go to Gamma’s command-line and type

nuget install VL.ColorThief -pre

as always, source patch is here.

enjoy!

5 Likes

very nice, thanks.

it’s just a pity that the c# implementation differs from the js one. in my tests, it fails for the dominantcolor, where it makes an averagecolor instead of the most dominant one.
as a workaround, i sorted the palette output by popolation (orderbydescending) and used the first slice as dominant color. at least that comes close to the original js imp.

i used this for comparison: https://lokeshdhakar.com/projects/color-thief/

2 Likes

thanks for the feedback!

just pushed a new GetColor (Sorted) node that uses the algorithm you described, seems much more accurate in some cases indeed.

1 Like