Jump to content

Archived

This topic is now archived and is closed to further replies.

Shawn05

GD Library: Finding Dominate Color

Recommended Posts

Does anyone know how to use GD Library to find the dominate color in an image other then black & white? Thank you.

Share this post


Link to post
Share on other sites
[a href=\"http://www.mayge.com/dominate-color.php\" target=\"_blank\"]http://www.mayge.com/dominate-color.php[/a]

google is your friend.

Share this post


Link to post
Share on other sites
lol google will take over the world. Thank you for your help

Any idea how I would check for shades of black and white so I can exclude them? There can be so many different shades so if you find an easier way let me know ;)

Share this post


Link to post
Share on other sites
It's slightly more complex to find the shades. One option could be to convert the current pixels colour from RGB to HSV and compare the saturation and value to a threshold, if it is within that threshold, don't include it in the array.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.