Skip to main content

ImagePixel

ImagePixel (Function)

Format

imagepixel ( image, x, y )

returns integer_expression

Description

Returns the color of the pixel at (x, y) in an image held in memory, as an integer that includes the alpha (transparency) channel. image is the identifier returned by ImageNew, ImageLoad, or ImageCopy.

Set a pixel with ImageSetPixel.

Example

a = imageload("photo.png")
c = imagepixel(a, 0, 0)
print "top-left pixel color value: " + c

See Also

ImageAutoCrop, ImageCentered, ImageCopy, ImageCrop, ImageDraw, ImageFlip, ImageHeight, ImageLoad, ImageNew, ImagePixel, ImageResize, ImageRotate, ImageSetPixel, ImageSmooth, ImageTransformed, ImageWidth, Unload

Availability

BASIC-256 2.0 and later. Documented from the BASIC-256 v2.1 continuation project.