PixInsight - Image Post Processing

Star Mask

updated: 2021-05-30


The MorphologicalTransform (MT) process is an advanced implementation of several morphological transforms. It does so by applying a function using a structuring element (a mask).


Menu: Process 🡺 All Processes 🡺 StarMask

Process Explorer: MaskGeneration 🡺 StarMask


Stretched image, file name “*_i_c_DBE_ABE_BN_CC_HT_MLT_FS.xisf” or similar into sub folder "aligned"


Stretched image, file name “*_i_c_DBE_ABE_BN_CC_HT_MLT_FS_SM.xisf” or similar into sub folder "aligned"

Previous Step

Next Step


https://www.youtube.com/watch?v=MhaW1mcybzk  (Part 10  Star Mask Shrink, time=10m33s)

Reference: PixInsight v1.5 - Unofficial Reference Guide: MaskGeneration (deepskycolors.com)





Open StarMask


Start with the fully stretched image

from any step after Full Stretch


Create a Preview Box + Open the Preview

in an area with some stars. This step is required to reduce the processing amount that would be required for the entire picture


Main Settings

Noise Threshold: decrease for more structure, increase to prevent inclusion of noise. If you set it too high, real stars are going to get missing in the star mask, too low and it will create star masks for non-existent stars (noise).

The noise threshold level must be set above the highest RGB levels that you can see at the bottom of the PI window when you hover over the preview window with you mouse or by clicking and holding the left mouse button while hovering:

Working Mode:

Scale: N. of wavelet layers for structure detection. Increase to include larger structure in the generated star mask


Test Result

by dragging the little triangle to the preview lead to these results:

Original Preview                                  Generated Star Mask

The result looked best with the settings on the right. Try different settings until the result looks good.


Close the Preview


Generate the StarMask

Drag the little blue triangle to the main image to see if it also impacts the nebula or other other objects (this take a little while...) 

As you can see, the big nebula on the left was not impacted by the function, that's a good result!

Original Image                          Star Mark    



Apply the StarMask to the Original Image

Pull the tab of the B/W stretched image right below the tab of the original image to apply the star mask

The red image is the MASK which will be used further. Notice the tab on the left side of the windows turned to brown indicating a mask. 

Everything in red is protected (here this is the background). By inverting the mask you can also protect the foreground which is good if you want to reduce noise on the background.

Make sure the background (and not the stars are protected) for the next steps, the background should appear red

Hide the mask with CTRL+K



Minimize the StarMask Image and the StarMask Process 


Open Morphological Transformation


Create a Preview Box + Open the Preview

on a typical star field area



Set MF Filters and Treshold

Try following settings:

Operator  🡺 description, try Erosion first

Interlacing: 1

Iterations: 1

Amount: 100%

Threshold Low: 0.05


Apply the Morphological Transformation on the Preview

Test the effect by clicking on Undo / Redo


Original                                                  After Morph



Remove the Preview and the Mask

Menu 🡺  Mask 🡺  Remove Mask



Apply the Morphological Transformation on the Entire Image


Close Morphological Transformation


Save the Image

file name like  “*_i_c_DBE_ABE_BN_CC_HT_MLT_FS_SM.xisf”

or "20170921_M8_FUJXT1_i_c_DBE_ABE_BN_CC_HT_MLT_FS_SCNR_SM.xisf" in this case

using postfix _SM

file name like  “*_SM.xisf”

Created with the Personal Edition of HelpNDoc: Make Documentation Review a Breeze with HelpNDoc's Advanced Project Analyzer