thephpleague / color-extractor

Extract colors from an image like a human would do.
thephpleague.com
MIT License
1.3k stars 159 forks source link

Return the score for each color #9

Closed celtric closed 10 years ago

celtric commented 10 years ago

Would it be possible to return the percentage of the image that each color takes?

I want to show only the meaningul colors of an image, so if a color is only used in 1% of the image (a shadow for example), I wouldn't like to show it.

MatTheCat commented 10 years ago

Hi. You don't have to get this percentage to ignore colors, a setMinColorRatio method is provided. It is broken on 0.1.* but the fix is on master, I'll create a new tag soon.

Thanks for making me realize that..!

MatTheCat commented 10 years ago

The fix is now on 0.1.2. Can I consider this issue resolved?

celtric commented 10 years ago

Thanks! I had tried setMinColorRatio but it kept running out of memory, so I avoided it (this stills happens with certain values, but I'll have to test it further).

You can close the issue, it's working for me now. Thanks again!