PixInsight Star Mask

Star masks are critical to the PixInsight process. Initially, the creation of a star mask is time consuming and prone to error until you find the right settings for your imaging rig.

To create a good star mask, you need to start with a stretched luminance image.

Create Luminance

For an unstretched image, do the following to create a baseline luminance image to help generate a star mark.

  • If using a monochrome image, simply duplicate the image. Right-click the image and select duplicate
  • If using a color image, select Channel Extraction. Select CIE L*a*b. Unselect a and b.

Once applied, a new image gets created that only contains the luminance.

Extracted Luminance
Extracted Luminance

If the image is in an unstretched state, it is good to run the DeLinear script to apply a stretch.

Install the DeLinear script from Herbert Walter Astrophotography (skypixels.at)  The Delinear script does the stretch automatically.

Optimize Luminance

It is a good idea to try and remove a lot of the noise and structure of the image before trying to create a star mask. This can be done by using the Multiscale Linear Transformation process within PixInsight.

We need to identify the right number of layers to remove from the image. The higher numbered layer relates to larger structure.

Optimizing Luminance
Optimizing Luminance
Optimized Luminance
Optimized Luminance

Turning on real-time preview allows you to quickly see what gets removed with each layer. Although there is still some nebula structure within the optimized luminance, the star mask process can handle this.

Once the bright nebula portions are removed, we need to remove noise. The noise will be picked up by the star mask process as stars.

Noise Reduction
Noise Reduction
Noise Reduced - Optimized Luminance
Noise Reduced – Optimized Luminance

Star Mask

What you will find with the Star Mask process is that no single setting will capture all of your stars. In most instances you will have 3-5 different instances to capture small, medium and large stars.

For my imaging rig, I use the following settings:

Tiny Stars
Tiny Stars
Star Mask - Tiny Stars
Star Mask – Tiny Stars
Small Stars
Small Stars
Star Mask - Small Stars
Star Mask – Small Stars
Medium Stars
Medium Stars
Star Mask - Medium Stars
Star Mask – Medium Stars
Large Stars
Large Stars
Star Mask - Large Stars
Star Mask – Large Stars

A few of the settings change based on the size of stars I’m capturing. General guidelines are as follows:

  • Noise Threshold: This is the limit to what is considered a star and what is consider noise. Simply moving the mouse pointer over the image will show a “K” value in the bottom status bar. You want to use this number to be lower than the value you see when you hit the edge of a star.
  • Scale: Adjust this higher to capture the bigger/brighter stars.
  • Structure Growth: I want to mask to be similar size of the actual stars, so I avoid using structure growth except for the smallest stars, because they are so small
    • Large-Scale: Increase so the size of the bigger stars are bigger than the actual stars as we need to protect the edges
    • Small-scale: Increase so the size of the smaller stars are bigger than the actual stars to better protect the edges
    • Compensation: Increase to control how large the tiniest stars can get
  • Mask Generation
    • Smoothness: Depending on the size of the stars, increase the smoothness to avoid square stars
    • Aggregate: Bases the mask by summing the values of all wavelet layers
    • Binarize: Creates a star mask where the stars are the same intensity across the entire star. I use binarize if my plan is to remove stars. If i want to reduce star brightness I do not use binarize.
  • Mask Preprocessing
    • Shadows: Increase to remove background noise.
    • Midtones: Decrease the level to apply a stretch to the newly created star mask and make detected stars brighter

You need to make sure that all of the star masks look good and that none of the nebula features were captured. The small star sample captured other stuff that should not be part of the star mask, so it is removed from the list.

Pixel Math

The multiple star masks must be combined to create a single star mask image. Within Pixel Math, the following formula creates a single image using the maximum values from each individual image .

  • Select Create new image
  • Color space: Grayscale
Star Mask Combination
Star Mask Combination
Joined Star Mask
Joined Star Mask

If the star mask is good, remember to save so you don’t lose all of your hard work.

Morphological Transformation

At this point, the mask captured our stars, but they do not cover the stars in their entirety. We need to bloat the stars so they are fatter and completely cover the stars. We do this with morphological transformation

Dilated Star Mask
Dilated Star Mask

The settings used for morphological transformation are

  • Operator: Dilation (will bloat the stars)
  • Iterations: 2 (run twice)
  • Amount: .75 (how strong should the dilation be)
  • Size: 7 (size of the star structure – larger yields smoother stars)
  • Dimension: Circle

Tips – Process Container

Once the Star Mask settings have been identified, create a Process Container to hold the multiple processes. The process container can be applied to the image and will run through all operations automatically.

Tips – Clone Stamp

Some images might include very large and very bright stars. Trying to mask these stars is extremely difficult due to the brightness bleeding beyond the outline of the star. Depending on the purpose of teh star mask (star color, starless images), it might be best to remove the star from the mask so it is not protected and results in a better end result.

To do this, simply use the Clone Stamp tool and remove the star from the mask.