99designs / colorific

Automatic color palette detection
ISC License
700 stars 55 forks source link

Black and white colors extraction using --min-saturation=0 #20

Open tiredenzo opened 10 years ago

tiredenzo commented 10 years ago

Hello there :) Thank you for your work ! I am having a hard time extracting white and black colors using --min-saturation=0 Any help would be appreciated !

deronsizemore commented 9 years ago

I'm having the same problem with blacks. I'm using this in a django application and it seems to extract white okay, but ignores black and I'd like to include black in the colors that are extracted. I'm using it like this:

extracted_palette = palette.extract_colors(image, max_colors=10, min_saturation=0)

min_saturation doesn't appear to have an effect on anything at all with how I'm using it. If you've figured out an answer I'd love to hear it.

EDIT: tested it once more with a different image. Whites seem to be hit or miss. Sometimes it will include white, other times it won't.

deronsizemore commented 9 years ago

Well I seem to have stumbled on a fix for my issue. min_saturation: 0 wasn't doing anything for me. I just guessed once and set min_saturation: None and now it seems to be giving me white and black values along with the rest of the colors it finds.

larsyencken commented 9 years ago

Ideally, setting --min-saturation=0 should get rid of the saturation filter. The fact that it doesn't is a bug. Glad you found a workaround for now.