Apply Mask
This function block filters an image using a mask image (black/white or grayscale) to keep or remove specific parts of the input image. It is intended for simple segmentation and masking workflows in AugeLab Studio.
π₯ Inputs
Imageβ Main image to be filtered (input socket).Maskβ Mask image used to define preserved areas (input socket). Accepts a binary, grayscale or color image. The block will treat white/bright mask pixels as kept areas and dark pixels as removed areas.
π€ Outputs
Filteredβ Resulting image after applying the mask (output socket).
πΉοΈ Controls
This block has no extra controls or widget settings. It performs masking based on the two provided inputs.
π¨ Features
Works with color (RGB) and grayscale images.
Accepts masks in grayscale or color; the mask is interpreted as a keep/remove map.
Keeps image pixels where mask is bright/white and hides pixels where mask is dark/black.
Designed for fast, visual filtering in processing chains.
βοΈ Running mechanism
When evaluated, the block checks both inputs, ensures the mask can be used as a binary selector, and then applies the mask to the main image. The output is the original image with non-masked areas removed (or set to black) according to the mask.
π Usage instructions
Provide the image you want to filter to the
Imageinput.Provide a mask image to the
Maskinput. Bright/white regions in the mask will be preserved in the output; dark/black regions will be removed.Connect the
Filteredoutput to downstream blocks (for visualization, saving, or further processing).
Tips:
If the mask and the image differ in size, resize or crop them so they match before connecting.
If your mask is a rough segmentation, combine this block with morphological or smoothing steps to refine results.
π‘ Tips and Tricks
Create masks from intensity values using the
Image ThresholdorImage Adaptive Thresholdblocks before feeding them into this block.Reduce noise in the mask source using
BlurorDenoisingto avoid small unwanted holes in the result.Improve foreground/background separation with
HSV Filterwhen color is a strong cue, then convert that result into a mask for this block.For higher-quality subject extraction, try
Background Removal (RMBG-1.4)orBackground Removal (BiRefNet)and feed the resulting mask or cutout into this block.Use
Morphological Transformationsto clean up small mask artifacts (erode/dilate) before applying the mask.Crop or focus processing with
Image ROI SelectorImage ROIso the mask and image align on the area of interest.Preview results with
Show Imageand save successful outputs usingImage LoggerorImage Write.
π οΈ Troubleshooting
Mask appears to do nothing: Verify the
Maskis aligned with theImageand that bright areas correspond to the regions you expect to keep. If sizes differ, useImage Resizeor crop withImage ROI Select.Output contains speckles or holes: Apply
BlurorMorphological Transformationsto the mask to remove small defects.No visible change after masking: Check that the mask actually contains non-black regions. Use
Image Thresholdto explicitly binarize uncertain masks.Need to inspect intermediate results: Insert
Show Imageafter mask creation steps to verify mask correctness before applying it.
π Evaluation
On execution this block outputs the Filtered image. Use the output to visualize, save, or feed into later analysis blocks such as detection or measurement.
Last updated