本站提供正體中文版。切換到正體中文本站提供简体中文版。切换到简体中文このサイトには日本語版があります。日本語で表示이 사이트는 한국어로도 제공됩니다.한국어로 보기Diese Website ist auch auf Deutsch verfügbar.Auf Deutsch ansehenEste sitio web también está disponible en español.Ver en españolQuesto sito è disponibile anche in italiano.Visualizza in italianoCe site est également disponible en français.Afficher en françaisEste site também está disponível em português.Ver em portuguêsDeze website is ook beschikbaar in het Nederlands.In het Nederlands bekijkenЭтот сайт также доступен на русском языке.Смотреть на русскомयह वेबसाइट हिन्दी में भी उपलब्ध है।हिन्दी में देखेंهذا الموقع متاح أيضًا باللغة العربية.عرض بالعربيةSitus ini juga tersedia dalam bahasa Indonesia.Lihat dalam bahasa IndonesiaBu site Türkçe olarak da mevcut.Türkçe görüntüleTa strona jest dostępna także po polsku.Wyświetl po polskuTrang web này cũng có phiên bản tiếng Việt.Xem bằng tiếng Việtاین وب‌سایت به فارسی هم در دسترس است.مشاهده به فارسی

Making a Nebula Mask: Two Approaches with MLT and StarNet

Stretching & Nonlinear2021.04Early notes

This article is compiled from notes taken in 2021. Some tools or workflows have since been updated, so please keep that in mind while reading.

A while back I came across a set of teaching materials for PixInsight beginners, in which the workflow switched over to Photoshop midway to make a nebula mask. I never quite understood this, because PI itself has plenty of tools for making all sorts of masks, so there’s really no need to jump out midway. I happened to have an image of NGC 6992 on hand, so I did it once in PI to see just how long making a nebulosity mask actually takes.

Let me give the answer first: manually using MLT, about 10 minutes; using StarNet, about 5 minutes.

Whichever method you use, the first step is the same: for color photos, extract the luminance channel first.

The MLT Approach (About 3 Steps)

  1. Use MLT (MultiscaleLinearTransform) to produce a star mask.
  2. Subtract this star mask from the Original image.
  3. That yields the preliminary nebulosity mask.

PixInsight process history: the processing steps of the MLT nebula-mask approach (MultiscaleLinearTransform → HistogramTransformation → PixelMath)

The StarNet Approach (About 2 Steps)

  1. Use StarNet to remove the stars.
  2. From the starless nebulosity image, subtract the star mask that StarNet produced.

PixInsight process history: the processing steps of the StarNet nebula-mask approach (StarNet → PixelMath)

The Difference Between the Two Approaches

The biggest difference between the two is that StarNet is much faster, and most of the time is spent on the star-removal computation. That said, StarNet’s selection of the nebulosity may be less thorough, whereas its selection of the stars is very complete (compared to using MLT).

A six-panel comparison of NGC 6992: top row from left, the original, the MLT star mask, and the StarNet star mask; bottom row, the nebulosity masks each produced by MLT and StarNet

Of course, the nebula masks obtained above are only first drafts and need further adjustment before they can actually be used—for example, Binarize, Dilation, Histogram Transformation, Curve Transformation, and so on. The finished, ready-to-use result is shown further down (the red one), and the principle is simply: mask where it should be masked (such as stars and background), and don’t mask where it shouldn’t be (nebulosity).

The applied effect of the finished, ready-to-use nebula mask: red marks the masked stars and background, while the nebulosity is left unmasked

Why I Don’t Recommend Using Photoshop’s Selection to Do It

Finally, a word on the selection-based mask-making approach from those teaching materials in Photoshop. It’s certainly simple and convenient, but the downside is that it selects too large an area, and the stars within the selection are still there. As a result, while enhancing the nebulosity you simultaneously enhance the stars inside the selection, causing the stars inside the selection to differ from those outside it—which is exactly what we want to avoid.

The approach from those teaching materials: in Photoshop, using the lasso tool to draw a rough selection around the outer edge of the nebulosity, then filling it white to make a mask