imagecolorat — Get the color index value of a pixel.
int imagecolorat ( resource $image , int $x , int $y )
Returns the color index value of the pixel at the specified position in the graphic specified by image.
If PHP is compiled with GD library 2.0 or higher and the image is a true color image, this function returns the RGB value of the point as an integer. Use shifting and masking to get the values of the red, green, and blue components.
Get the respective RGB values.
<?php$im = ImageCreateFromPng("codercto-logo.png");$rgb = ImageColorAt($im, 100, 25);$r = ($rgb >> 16) & 0xFF;$g = ($rgb > > 8) & 0xFF;$b = $rgb & 0xFF;?>
imagecolorset() Sets the color for the specified palette index.
imagecolorsforindex() Gets the color of an index.