Home > PHP > Function > GD > imagecolorat()

imagecolorat()

imagecolorat - Get the index of the color of a pixel

Syntax

int imagecolorat (resource $image, int $x, int $y)

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
  • x - x-coordinate of the point.
  • y - y-coordinate of the point.

Description

Returns the index of the color of the pixel at the specified location in the image specified by image.

Version

PHP 4, 5

Return value

Returns the index of the color.