.. highlightlang:: us .. index:: ImageGetPixelColor .. _imagegetpixelcolor: ImageGetPixelColor ================== .. us.tag ImageGetPixelColor NOTREADYENGLISH Image ImageGet New520 Changed532 :ref:`ImageGetPixelColor` returns the color value of a pixel as an RGB value. .. function:: rgb = ImageGetPixelColor(hImg, x, y) rgbMat = ImageGetPixelColor(hImg) .. us.return **Return Value** *rgb* is the scalar color value of the specified pixel in the range 0 to 255. If x or y is out of range the function returns the color value of the pixel x=1, y=1. In case of an error the functions returns -1. To convert the color value to an RGB color vector: ``rvRGB = [(rgb & 0x000000ff), (rgb & 0x0000ff00) >> 8, (rgb & 0x00ff0000) >> 16]`` .. us.params **Parameters** .. uparam:: hImg *hImg* identifies the picture created with :ref:`ImageCreate`. .. uparam:: x *x* is the horizontal pixel position in the range 1 to :ref:`ImageGetWidth`. .. uparam:: y *y* is the vertical pixel position in the range 1 to :ref:`ImageGetHeight`. .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.3.2 - * - 5.2.0 - New .. seealso:: :ref:`overview-pictures`, :ref:`ImageGetPixelGray`, :ref:`ImageGetWidth`, :ref:`ImageGetHeight` :sub:`id-968740`