Create Luminance and Range Masks for Selective Adjustments
Build a lightness-derived mask or a RangeSelection mask, verify its protection, and use it to control a selective adjustment. Learn how to preserve backgrounds, soften transitions, and avoid accidentally processing the wrong areas.
Sources reviewed October 25, 2026
A mask controls where a process acts
A mask is an aligned image that controls how much of an adjustment reaches each pixel of a target. In PixInsight, white permits the effect, black protects, and gray permits a partial effect. A mask does not change the target until you apply an operation that uses it.
This lesson builds masks from a permanently stretched image for finishing work. A lightness-derived mask provides continuous brightness-based protection. A range mask selects an interval of brightness, with adjustable transitions. Neither identifies objects by meaning: a star and a nebular knot of similar brightness can both be selected.
These masks are useful before HDRMT, LHE, or selective curves. They are different from a separate luminance exposure used in LRGB, a color mask selecting hue, or a star mask intended to isolate stars.
1. Preserve the image and choose the intended effect
Save Target_before_masked_adjustment.xisf and make a working duplicate. Turn STF off and confirm the target is permanently stretched. This finishing exercise does not require altering the linear master.
Decide what should change before constructing the mask. To enhance the nebula while protecting faint sky, the nebula should be lighter in the mask and the sky darker. To adjust the background while protecting the object, reverse that relationship.
Keep mask and target at identical dimensions, orientation, crop, and pixel alignment. Do not resample or crop only one after building the mask. If the target changes substantially, rebuild or recheck the mask rather than assuming an old one still fits.
2. Create a lightness-derived mask
The common term luminance mask includes several brightness-derived approaches. This exercise explicitly uses CIE L* lightness for a color image; it does not extract a physical luminance exposure.
- Activate the stretched color source. Open ChannelExtraction through All Processes, select CIE L*a*b*, enable only L*, and create the extracted grayscale image with Apply Global. For an already grayscale target, duplicate it instead.
- Rename the new grayscale view Target_lightness_mask. Check recognizable features against the target and preserve its geometry.
- On the mask copy only, use HistogramTransformation or CurvesTransformation to darken the low-signal sky and leave the intended object region lighter. Adjust gradually; a weak gray mask can permit a modest effect without forcing every selected pixel to white.
- Inspect the actual mask pixels with STF off. A display stretch on the mask does not change its protection. Confirm that you edited the mask copy rather than the target.
- Keep transitions smooth. If needed, apply a small Convolution to a mask duplicate and compare its edges. Choose smoothing for the image scale instead of copying a fixed blur value; excessive blur can spread the allowed effect into protected areas.
3. Build an alternative with RangeSelection
RangeSelection gives more direct control over which brightness interval contributes. It is an alternative to the lightness mask above; you do not need to apply both automatically.
- Activate the stretched source and open RangeSelection through All Processes. Reset the instance, enable Lightness for this brightness-based color-image exercise, and open its real-time preview.
- For a first object-selection trial, keep Upper limit at 1 and raise Lower limit gradually until the unwanted sky becomes dark while useful object structure remains selected. Begin with Invert, Screening, and Link range limits off so the baseline is easy to interpret; use installed help for their current definitions.
- Adjust Fuzziness to refine how the intensity selection transitions, and Smoothness to soften spatial boundaries. Watch faint object edges and bright cores. There are no universal lower-limit or smoothing numbers for differently stretched images.
- Inspect the whole field and several 1:1 areas. Bright stars will often be selected too. A range mask is not a substitute for star protection merely because the background looks dark.
- Create the mask as a separate output using RangeSelection’s Apply Global control, then rename it Target_range_mask. Inspect the generated image with STF off and verify it matches the preview before attaching it.
4. Attach and verify the mask
Activate the target and choose Mask → Select Mask, selecting the intended grayscale view. Enable the mask and show its overlay. Check both the mask itself and whether Mask → Invert Mask is active; overlay appearance alone can be misleading.
For object contrast with background protection, inspect that the object is lighter and the sky darker in the effective mask. For a background-only adjustment, invert the protection and inspect again. Inverting the attached mask is different from editing the saved mask pixels; record which method you used and avoid accidentally doing both.
Hiding the overlay makes it easier to judge the picture, but does not disable the mask. Disabling the mask removes its protection while leaving it associated with the target. Learn these controls before applying a strong adjustment.
5. Test a small selective adjustment
On a disposable target duplicate with the validated mask, open CurvesTransformation. Make a small lightness or contrast adjustment and compare before and after. Keep STF off, check the intended region, then inspect the protected background and the boundary between them.
Undo the trial before changing the mask or process for another comparison. Keep one variable fixed while testing the other; changing both mask contrast and adjustment strength at once makes the result difficult to explain.
Once protection is confirmed, follow the HDRMT, LHE, or selective-curves guide for the intended operation. Process-specific internal masks can add further protection; they do not make an attached mask irrelevant. Check the particular tool’s masking behavior in its help.
A good mask controls the distribution of an effect, not its overall quality. Lower the process strength if the result is harsh. Do not try to rescue an excessive adjustment merely by making an increasingly complicated mask.
Common mask goals
Inspect the effective protection for the specific adjustment rather than choosing a mask by its name alone.
| Goal | What should be lighter | What needs inspection |
|---|---|---|
| Enhance object structure | The intended object regions | Low-signal sky and bright stars may need extra protection |
| Adjust the background | Background areas | Inverted object masks can also select faint dust or noise |
| Control a bright core | The core with a gradual surrounding transition | Hard boundaries can create seams or halos |
| Protect stars | Only the nonstellar regions to be changed | Brightness selection alone cannot distinguish stars from bright object detail |
Troubleshooting and saving
Nothing changes: check the target, mask enable state, inversion, process strength, and actual mask values. A mask that appears bright only under STF can still provide strong protection.
The wrong region changes: compare white/black meaning with the intended operation and check for double inversion. Confirm the process was applied to the target, not the mask.
Halos or seams appear: inspect sharp mask transitions and mismatched geometry, then compare a softer mask or gentler adjustment. More blur is not always better.
Noise becomes prominent: check whether low-signal regions are being allowed through. Dark dust is not automatically empty background, and a range selection cannot determine whether a feature contains enough signal for enhancement.
Stars change unexpectedly: inspect the mask around their profiles. Consider a starless workflow or a dedicated star-protection mask; do not assume brightness limits isolate the nebula alone.
Save the mask, pre-adjustment target, accepted result, and relevant process instances. Record the source stage, extraction method or range settings, mask edits, geometry, and inversion state. Disable or remove the attached mask before an unrelated next operation unless you intend it to remain active.
This is an original beginner exercise based on the linked mask concepts and worked examples. Older screenshots are not current defaults; installed process help governs version-specific controls. Use a mask only where it serves the intended adjustment.