Automatic, measurement-driven star mask generation for PixInsight. [more]
Categories: DeepSkyColors, Mask, StarMask
Keywords: star mask, stars, mask, wavelet star detection, halo, glow, growth, feather, roundness, nebula rejection, dynamic live preview.
[hide]
[hide]
DeepStarMask builds a grayscale star mask — an image that is bright where the stars are and dark everywhere else — so we can protect or isolate stars while we process the rest of the frame. It finds stars with a multiscale (wavelet) detector and then synthesizes the mask one star at a time.
What sets it apart from a conventional star mask is that the coverage of each star is measured from that star's own light, not stamped from a single global radius. A bright giant with a wide glow gets a large, soft halo; a faint pinpoint stays tight — both from the same settings. On top of the measured solid region, DeepStarMask adds a smooth, size-aware feather, and it includes specific defenses so that bright nebula is not mistaken for stars.
Everything is tuned through the Dynamic Live Preview: a dedicated window that can show the mask applied to our image, the mask in isolation, or the target image alone. We can also zoom-in up to 32x, pan and other useful viewer tools that we can use while the preview is refreshed live as we move the controls. A one-click full-resolution render is always one button away to confirm the exact result.
[hide]
The only official distribution of DeepStarMask is via a PixInsight repository. This is the safest way to install a module or script, as the installation is handled by PixInsight itself, which will fetch the module directly and safely from our PixInsight repository at
https://repo.deepskycolors.com/DeepStarMask/
Make sure the trailing / is part of the URL. Also, be sure to keep our repository URL in our list of PixInsight repositories to receive timely updates.
By distributing DeepStarMask only via our PixInsight repository, installation comes with the guarantee of our Developer and Repository certificates, verified by PixInsight itself from the moment it connects to our repository, until it validates and completes installation of the DeepStarMask module.
If we ever want to be sure that we have the latest version available to us, we go to PixInsight's RESOURCES menu, select Updates, then Manage Repositories to make sure our repository is still there, then RESOURCES > Updates > Check for Updates.
DeepStarMask is a standard PixInsight process — we set its parameters on the process dialog and apply it to a view. To launch it:
Applying the process creates a new single-channel mask image named <view>_stars. A short detection report is printed to the Process Console (number of stars detected, masked, rejected, contained, and the final mask coverage).
DeepStarMask runs on a trial-then-registered licensing model. During the trial period, the tool is fully functional with no feature restrictions. When the trial expires, DeepStarMask will display a notice at startup and will not open until a valid registration key is entered (see 3.5 Registration and licensing). No internet connection is needed: keys are validated offline.
[hide]
The panel is organized into three collapsible groups — Star detection (which stars are found), Mask synthesis (how each found star becomes mask coverage), and Dynamic Live Preview (the interactive preview controls).
A note on responsiveness. While we drag a slider, the preview does not recompute on every intermediate value — it refreshes once, when we release the mouse, so dragging stays smooth. Typed values and the spin arrows refresh immediately.
This group governs which structures are recognized as stars. DeepStarMask uses PixInsight's multiscale wavelet star detector, so these controls map to well-understood detection behavior:
Once stars are detected, this group decides how each one becomes mask coverage.
Star profiling selects the model used for the solid part of the mask:
Growth sets how far the solid part of the mask extends around each star. The crucial point is that the extent is not a fixed number of pixels — it is relative to each star's own size, so a single setting scales automatically: large, bright stars get large fills and faint stars stay tight.
Either way, raising Growth only ever grows the mask — it moves in one direction. (In Light spread mode the fill is additionally bounded by Max spread ratio; once it reaches that cap it simply holds steady rather than shrinking — see 3.3.)
Feather adds a smooth, soft margin outside the solid region — an even gradient that falls off from the solid edge all the way to the sky. Its width is scaled to each star's size, so it remains visible even on small, steep stars, not only on the largest ones. A Feather of 0 gives a hard edge; higher values give a wider, gentler transition. The whole added band is a true gradient (no near-solid inner ring). Feather applies in both profiling modes (in Star core mode it softens the core disk).
A bright star sitting on bright nebula is the classic failure case for star masks: the measured fill can escape the star and flow into the surrounding nebula, producing a blob far larger than the star. DeepStarMask has two controls (both relevant only in Light spread mode, which is the mode that measures a fill) to contain this:
The detection report in the Process Console tells us how often each defense fired: rejected (roundness) counts patches skipped by Min roundness, and contained (oversized) counts fills capped by Max spread ratio.
This is the heart of interactive tuning. Instead of guessing and re-applying, we open a dedicated Dynamic Preview window that shows the star mask applied to our image and refreshes live as we move any control. The group has a small two-button toolbar plus two option menus.
Preview button (blue-ring icon) — opens or closes the Dynamic Preview window. The window shows the mask on the image (not in isolation) and has its own toolbar: zoom (in / out / fit / 1:1), an STF auto-stretch (so a linear image is not near-black), and mask display modes — image only, mask only, overlay (the mask tinted over the image), and side-by-side. The source image is captured when we open the preview; it can be the main view or a selected preview region.
Nuclear button (red-ring icon) — a one-shot that renders the preview once at full resolution: every star detected and synthesized exactly as the applied mask will be. We use it to confirm the exact result, since the live preview works on a downscaled copy for speed (so the very smallest stars may not show). It can take a moment on large frames; the result stays in the window until our next parameter change replaces it with a fast live render. It is enabled whenever the image is larger than 1024 px (where the live preview is downscaled), and disabled for smaller images, where the live preview is already full resolution.
How the speed works. The live preview computes on a downscaled copy of our image: detection at a resolution we choose, and synthesis plus display at about 1024 px. That keeps tuning fast even on very large frames. Two menus govern the speed/accuracy trade, and both affect only the preview — never the applied mask:
When our image already fits within about 1024 px, the live preview is full resolution to begin with: there is nothing to downscale, so the Detection and Downsample menus and the Nuclear button are all disabled.
Because the Dynamic Preview is a genuine image-display engine (not PixInsight's built-in Real-Time Preview), it can show the mask applied with overlay and side-by-side modes — which is why DeepStarMask uses it as its single, canonical preview. The same engine is shared across our Deep Sky Colors tools, so its controls feel the same everywhere.
The Preferences button (the wrench icon on the process interface bar) opens the DeepStarMask license information dialog. This dialog reports the current license state:
When the module is not yet licensed, the dialog shows a "Click here to register" link. Clicking it opens the registration dialog, where we enter our email and license key. The fields are validated as we type, and the Register button enables only once a valid email/key pair is entered. After a successful registration the info dialog refreshes in place to the "licensed to" state — no need to reopen it.
[hide]
A typical workflow:
Open the image and launch DeepStarMask. Select the image, then click the Preview button to open the Dynamic Live Preview so we can see the mask on the image as we work. Set the preview's display mode to overlay or side-by-side.
Get detection right first. In the Star detection group, make sure every star we care about is found: keep Include clustered stars on for rich fields, lower Min structure size and Noise layers to keep the smallest stars, and raise Sensitivity for fainter ones. Raise Scale (layers) if the largest stars are missed. If small stars are missing in the preview, raise the Detection resolution (or click Nuclear to check the exact full-resolution result).
Choose a profiling mode. Leave Light spread for a natural mask that follows each star's real glow, or pick Star core for a tight, predictable disk-based mask.
Shape the coverage. Use Growth to set how far the solid mask reaches around each star (it scales per star automatically) and Feather for the softness of the margin.
Defend against nebula if needed (Light spread mode): lower Max spread ratio to contain fills that leak into bright nebula (or raise it so genuinely large stars keep their full halo), and raise Min roundness from 0 only if lobed nebula patches are being masked as stars.
Apply the process to the view. DeepStarMask creates the <view>_stars mask image and prints a detection report to the console. Save the instance as a process icon to reuse the exact same settings later.
How the mask is built (overview). Stars are detected with a multiscale wavelet transform. For each star, in Light spread mode DeepStarMask measures the local sky and floods outward from the star's center down to a low level above that sky (Growth sets how low), giving a solid region that follows the star's true footprint; runaway floods on nebula are capped (Max spread ratio) and lobed patches can be rejected (Min roundness). In Star core mode the solid region is instead a disk sized from the detected area and scaled by Growth. A smooth, size-aware spatial feather is then grown outward from the solid region, and every star is max-composited into a single-channel floating-point grayscale image suitable for use anywhere PixInsight accepts a mask. The applied mask is always computed at full resolution, regardless of the live preview's resolution settings.
[hide]
Detection before synthesis. If a star is not detected, no amount of Growth or Feather will mask it. Get the Star detection group right first, then shape the coverage.
Tune with the Dynamic Live Preview. Seeing the mask applied to our image (overlay or side-by-side) tells us far more than the mask alone — especially around bright stars and nebula edges. Synthesis tweaks refresh instantly.
Growth scales itself. We do not need different settings for bright and faint stars: one Growth value covers each star in proportion to its own light, and it only ever grows the mask. Reach for it first to set overall coverage.
Max spread ratio is a cap, not a dial. If raising it does nothing, that is expected — our stars are not leaking. Lower it only when bright nebula is being swallowed; raise it when a genuinely large star is being clipped to a disk.
Use Min roundness sparingly. It is a last line of defense against star-shaped nebula knots. Raise it just until the offending patches drop; too high and real merged or spiky stars start disappearing. Leaving it at 0 is fine for most fields.
Small stars missing in the preview? The live preview detects on a downscaled copy. Raise the Detection resolution to recover them, switch Downsample to Preserve peaks, or press Nuclear for the exact full-resolution render. The applied mask always uses every star regardless of the preview setting.
Noise layers behaving oddly in the preview? Set Downsample to Clean background — on the downscaled detection image, the grainy Preserve peaks mode can make Noise layers add small stars as we raise it. Clean background behaves like the real image.
Star core for a controlled mask. When we want predictable, tight disks (for example to combine with another mask), switch profiling to Star core — Growth and Feather still apply, now to the core.
Watch the console report. The rejected and contained counts tell us whether our nebula defenses are firing, and the coverage percentage is a quick sanity check between settings.
Save as a process icon. The full parameter set is serialized into the instance, so we can drag it to a process icon and re-apply the same star mask recipe to other frames.
Copyright © 2026 Deep Sky Colors. All Rights Reserved.