imagecolorat
can only return the color index for a single point,
is there a function to get all colors in an image?
imagecolorat
can only return the color index for a single point,
is there a function to get all colors in an image?
$im = imagecreatefromgif('php.gif');
$colorCount = imagecolorstotal($im);
$colorSet = array();
for($i=0; $i<$colorCount; ++$i) {
$colorSet[] = imagecolorsforindex($im,$i);
}
It is not very documented, but I think you could use the ImageMagick method described here : http://fr.php.net/manual/en/function.imagick-getimagehistogram.php