Get Pixel
This function block reads the color value at a specific image coordinate and returns it for further use. It supports both color (BGR) and grayscale images and validates the supplied coordinate before sampling.
π₯ Inputs
Image Any Main image to sample from
Point Coordinate of the pixel to read (format: (x, y))
π€ Outputs
(Blue, Green, Red) Pixel value read at the given coordinate.
For color images this is the B, G, R channels returned together.
For grayscale images a single-channel value is returned.
πΉοΈ Controls
This block has no interactive controls or widgets.
π¨ Features
Simple pixel sampling by coordinate.
Works with color (BGR) and grayscale images.
Input validation with clear error messaging when the image is invalid or the coordinate is outside image bounds.
Returns values in a format ready to connect to other blocks that accept pixel or numeric data.
βοΈ Running mechanism
The block reads the image from the first input socket and the coordinate from the second socket.
If the image or coordinate is invalid, the block reports an error to help you correct inputs.
If valid, the block samples the pixel at the given (x, y) position and outputs its channel values.
π Usage instructions
Connect an image-producing block to the
Image Anyinput.Provide a coordinate to the
Pointinput. Coordinates are provided as (x, y).Use the
(Blue, Green, Red)output where needed (for display, comparison, logging, etc.).
π‘ Tips and Tricks
Combine with
Get Pixel Mouseto pick coordinates interactively by clicking on the image.Use
Show Imageto preview the image while you choose sampling coordinates.Visualize the sampling location by sending the coordinate to
Draw Pointso you can confirm the correct pixel is being read.Crop the image first with
Image ROIorImage ROI Selectto restrict sampling to a region of interest and avoid out-of-bounds coordinates.Validate that a point is inside a selected area using
Check Areabefore sampling to avoid errors.Log or export sampled values using
Image LoggerorCSV Exportfor later analysis.
π οΈ Troubleshooting
If you see an error about the image input, ensure the connected block actually provides an image and that the data is not empty.
If you see an error about the coordinate, check that the (x, y) values are integers and lie within the image width and height.
When sampling from a grayscale image, expect a single-channel value rather than three channel values.
Last updated
Was this helpful?