GD dominant colo(u)r function
Posted: Wed Nov 14, 2007 8:12 am
Hi guys,
Anyone have any idea how to start a function which selects the dominant colour in a 50x50 square? I can store all RGB values into an array using a foreach() and this...
however I'm not sure how to put this together
Any help appreciated, thanks in advance.
Anyone have any idea how to start a function which selects the dominant colour in a 50x50 square? I can store all RGB values into an array using a foreach() and this...
Code: Select all
$rgb = imagecolorat($img, $xpos, $ypos;
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> & 0xFF;
$b = $rgb & 0xFF;Any help appreciated, thanks in advance.