Image:getPixel

Returns the value of a pixel of the Image.

r, g, b, a = Image:getPixel(x, y)

Arguments

NameTypeDescription
xnumber The x coordinate of the pixel to get (0-indexed).
ynumber The y coordinate of the pixel to get (0-indexed).

Returns

NameTypeDescription
rnumber The red component of the pixel, from 0.0 to 1.0.
gnumber The green component of the pixel, from 0.0 to 1.0.
bnumber The blue component of the pixel, from 0.0 to 1.0.
anumber The alpha component of the pixel, from 0.0 to 1.0.

Notes

The following texture formats are supported: rgba, rgb, r32f, rg32f, and rgba32f.

See also