Gimp.Drawable.get_pixel

### Method

# Gimp Drawableget_pixel

#### Declaration [src]

    guint8*
    gimp_drawable_get_pixel (
      GimpDrawable* drawable,
      gint x_coord,
      gint y_coord,
      gint* num_channels
    )

#### Description [src]

Gets the value of the pixel at the specified coordinates.

This procedure gets the pixel value at the specified coordinates. The ‘num_channels’ argument must always be equal to the bytes-per-pixel value for the specified drawable.

#### Parameters

`x_coord`

  Type: `gint`

  The x coordinate.

`y_coord`

  Type: `gint`

  The y coordinate.

`num_channels`

  Type: `gint*`

  The number of channels for the pixel.

  The argument will be set by the function.

#### Return value

Type: An array of `guint8`

         The pixel value.
         The returned value must be freed with g_free().

The length of the array is in the `num_channels` argument.
The caller of the method takes ownership of the data, and is responsible for freeing it.