RGB Set
This function block selects pixels in an image based on red, green and blue channel ranges and replaces those pixels with a chosen color. Use it to isolate color regions (for masking, visualization or further processing) without any technical setup.
📥 Inputs
Image Any Main image to be processed (any color image).
Mask Color Optional replacement color used for pixels that match the selected RGB ranges. If not provided, matched pixels are set to black.
📤 Outputs
Image Any Resulting image where pixels within the selected RGB ranges are replaced by the Mask Color (or black if none provided).
🕹️ Controls
Red Value (Min-Max) Horizontal range slider to set minimum and maximum accepted red channel values.
Green Value (Min-Max) Horizontal range slider to set minimum and maximum accepted green channel values.
Blue Value (Min-Max) Horizontal range slider to set minimum and maximum accepted blue channel values.
⚙️ How it runs
The block examines every pixel in the input image and checks whether its R, G and B values fall inside the ranges specified by the three sliders.
Pixels whose channels all lie within the selected ranges are considered matched.
Matched pixels are replaced with the color provided to the
Mask Colorinput. If no color is provided, matched pixels become black.The processed image is emitted on the output socket and can be previewed or passed to other function blocks.
✨ Features
Per-channel min/max sliders for precise color range selection.
Optional external color input to set the replacement color dynamically.
Instant preview friendly—adjust sliders and see updated results when used with an image display block.
Works with any standard color image format accepted by the system.
📝 Usage Instructions
Connect a color-producing block to the
Image Anyinput (for example a camera block or an image loader).Adjust
Red Value (Min-Max),Green Value (Min-Max)andBlue Value (Min-Max)sliders to select the desired color range.Optionally connect a color source to
Mask Colorto define what matched pixels should be replaced with.Use the output image for visualization or feed it into further processing blocks.
💡 Tips and Tricks
To make color selection easier, first use
HSV Filterto narrow down the desired region in a more perceptual color space, then feed the result into this block.Use
Blurbefore this block to reduce noise and avoid tiny speckle matches.Use
Image ThresholdorImage Color Matchif you prefer single-channel or reference-based matching before refining with RGB ranges.Crop the area of interest with
Image ROIorImage ROI Selectto limit processing to a smaller region and speed up experimentation.For visual verification, connect the output to
Show Imageto preview the replaced pixels in real time.If you plan to feed this result into segmentation or masking operations, combine with
Apply Maskto isolate or blend matched areas with other images.
🛠️ Troubleshooting
No pixels change: widen the min/max ranges or try preprocessing with
HSV FilterorBlurto increase robustness.Too many unwanted pixels matched: narrow the ranges, test each channel individually, or use
Image ROIto limit the search area.Replacement color not applied as expected: ensure the
Mask Colorinput provides a valid color (three-channel value). If left disconnected, matched pixels will become black.Slow performance on large images: reduce image size with
Image Resizeror crop withImage ROIbefore using this block.
Last updated