RGB Mask
This function block applies a color-range mask to an image using separate Red / Green / Blue min-max sliders. Use it to isolate or extract image regions that fall inside a chosen RGB color range. Optionally, provide a replacement color to fill areas outside the mask.
π₯ Inputs
Image Any Input
Provide the source image to be masked (color image).
Mask Color Input
Optional pixel color used to fill areas that are excluded by the mask (three-channel color).
π€ Outputs
Image Any Output
The resulting image where only pixels inside the chosen RGB ranges remain (areas outside can be left black or filled with the provided Mask Color).
πΉοΈ Controls
Red Value (Min-Max) Control
Adjust the minimum and maximum allowed red channel values.
Green Value (Min-Max) Control
Adjust the minimum and maximum allowed green channel values.
Blue Value (Min-Max) Control
Adjust the minimum and maximum allowed blue channel values.
π¨ Features
Interactive three-channel masking using min/max sliders for each channel.
Live visual feedback: change sliders and observe how the output image retains only the selected colors.
Optional fill color: provide a
Mask Colorinput to replace excluded areas with a chosen color for clearer visualization or downstream processing.
π Usage Instructions
Connect a color image to the
Image Anyinput.Move the
Red Value (Min-Max),Green Value (Min-Max), andBlue Value (Min-Max)sliders to select the color range you want to keep.Optionally connect a pixel to
Mask Colorto fill excluded areas with a chosen color.Use the
Image Anyoutput as the masked image for viewing or further processing.
π Evaluation
When executed, the block creates a mask from the RGB ranges you set and applies it to the input image. The output image contains only the pixels inside the chosen ranges; excluded pixels are either black or replaced with the provided Mask Color.
π‘ Tips and Tricks
Use
HSV Filterbefore this block when lighting or color variations make RGB ranges unreliable β HSV often separates hue from brightness and helps isolate colors more robustly.Crop the input with
Image ROIto narrow the area of interest before masking β this reduces false matches from irrelevant background.If you need to preview results larger or in detail, connect the output to
Show Imageto open the image viewer.Resize very large images with
Image Resizerbefore masking to speed up interactive slider tuning.After refining ranges, combine results with transformation or export blocks (for example, save final images via
Image Write).
π οΈ Troubleshooting
No visible change: expand the min-max ranges for the channels until you see the target color appear.
Too many areas selected: tighten the channel ranges or try using
HSV Filterto isolate hue more precisely.Replacement color not applied: ensure a valid three-channel value is provided to
Mask Color.Uneven results under different lighting: test with different lighting conditions or preprocess with
BlurorContrast Optimizationto stabilize color appearance.
Last updated