color-thief icon indicating copy to clipboard operation
color-thief copied to clipboard

Update color-thief.js

Open guillaumehilaire opened this issue 10 years ago • 6 comments

for get dominant color if the file is white dominant

guillaumehilaire avatar Oct 28 '14 16:10 guillaumehilaire

Hi, In fact, the script skips the white pixels (>rgb(250,250,250)) of the image in order not to return white as the dominant color of an image with a white background like below : chats I think that asserting that the dominant color of an image as the one above is white is not really accurate. However, if white is really part of the image (clouds in the sky, white clothes,...), it's true that it should be taken into account. So maybe it would be better to add an option to indicate whether or not you want to ignore white pixels. Or, even better, add an option to specify one or more colors to ignore ?

ksubileau avatar Oct 28 '14 20:10 ksubileau

I see similar behavior for a mostly-dark image. Can this be behavior be turned off in an option/parameter?

programmin1 avatar Apr 19 '15 04:04 programmin1

No, not yet.

ksubileau avatar Apr 19 '15 08:04 ksubileau

it would be very nice to be able to have a flag to detect if white is the dominant color

alexiskattan avatar Sep 20 '17 02:09 alexiskattan

I'd like to specifically detect when white is the dominant colour of the image.

frumbert avatar Oct 24 '18 02:10 frumbert

@ksubileau @alexiskattan Would it be better to:

  1. Manual = send a color list to ignore as dominant
  2. Auto = allow for ignoring the first dominant color

zamartz avatar Dec 02 '18 17:12 zamartz