Tutorial (PixInsight):
Producing Masks
Anyone who has post-processed images before, in either PixInsight or Photoshop, will appreciate the importance of masks. These are same-sized images that can be used as an overlay for images you are post-processing and they act as protection. For example, you may be post-processing an image of a galaxy surrounded by stars and a lot of background. When you are applying noise reduction, the intention is normally to apply it to the background, not the galaxy (not anywhere near as aggressively anyway). A mask can be used in this situation - to protect the galaxy from application of your noise reduction technique. Similarly, it can be used to protect the background from increases to sharpness, as you may only want to sharpen the fine details in the galaxy itself.
Masks are used in a lot of the stages in post-processing and PixInsight has a number of processes and techniques that allow you to produce masks. Different masks can be used for different stages of post-processing and for application of different techniques. This tutorial covers a number of ways you can produce a mask in PixInsight as well as how to modify them to increase suitability. For each proposed method for how to produce a mask is a set of suggestions as to where this kind of mask is most applicable.
Assumed for this tutorial:
Please feel free to ask questions or leave comments via the comments section on the bottom of this page.
Masks are used in a lot of the stages in post-processing and PixInsight has a number of processes and techniques that allow you to produce masks. Different masks can be used for different stages of post-processing and for application of different techniques. This tutorial covers a number of ways you can produce a mask in PixInsight as well as how to modify them to increase suitability. For each proposed method for how to produce a mask is a set of suggestions as to where this kind of mask is most applicable.
Assumed for this tutorial:
- Knowledge of operating PixInsight, related to dealing with images, processes and working with masks (read this, sections 3, 4 and 6).
- Your images have already been pre-processed fully (read this).
Please feel free to ask questions or leave comments via the comments section on the bottom of this page.
1. Producing Masks by Duplicating Monochrome Images
+ Works equally well with linear and non-linear images.
+ Can be produced with very little effort.
+ Provides varying degrees of protection depending on brightness of image across different areas, which is perfect for overall noise reduction.
+ Includes everything - stars, nebulosity and galaxies.
- Is not selective of particular structures of interest as it is a simple duplicate.
When working with monochrome images such as a Luminance image, one can produce a mask very quickly, which serves its purpose very well for initial noise reduction. The following is a linear Luminance monochrome image open in PixInsight, auto-stretched.
+ Can be produced with very little effort.
+ Provides varying degrees of protection depending on brightness of image across different areas, which is perfect for overall noise reduction.
+ Includes everything - stars, nebulosity and galaxies.
- Is not selective of particular structures of interest as it is a simple duplicate.
When working with monochrome images such as a Luminance image, one can produce a mask very quickly, which serves its purpose very well for initial noise reduction. The following is a linear Luminance monochrome image open in PixInsight, auto-stretched.
We can produce an effective mask by right-clicking on the image and clicking Duplicate.
The auto-stretch is duplicated as well by default but I reset it on the duplicate image. An image in its linear state does not, by definition, have much contrast. A mask image becomes most effective when there is a lot of contrast, owing to the fact that white could protect completely and black would therefore not protect at all, with shades of grey varying the degree of protection. The auto-stretch does not alter the image so we need to apply the auto-stretch in a permanent manner. To do this, we open the ScreenTransferFunction process, responsible for auto-stretches. Once opened, we select the duplicate image and click the Auto Stretch button.
We will need to transfer these stretch parameters stored in ScreenTransferFunction to HistogramTransformation, the process responsible for producing permanent stretches. To do this, we open HistogramTransformation (keeping ScreenTransferFunction open) and drag and drop the New Instance button from ScreenTransferFunction on to the bottom bar of HistogramTransformation.
We can now remove the auto-stretch on the duplicate image from ScreenTransferFunction by clicking its Reset button and then click Apply on HistogramTransformation with the duplicate image selected. This applies the same stretch but permanently instead.
Both ScreenTransferFunction and HistogramTransformation processes can be closed now. The duplicate image is now a ready mask image. Applying it to the still linear Luminance image shows how it protects with varying degrees of strength depending on how bright an area of the image is.
This can be used as an extremely effective mask for noise reduction. You will have to invert the mask when it is applied in order to attack the background more than the high signal areas.
If your original image is already non-linear because it has been stretched, you can simply duplicate it and your mask image will be instantly ready for use (being a duplicate of the original, it is already already stretched and non-linear, providing the high contrast needed to act as an effective mask).
If your original image is already non-linear because it has been stretched, you can simply duplicate it and your mask image will be instantly ready for use (being a duplicate of the original, it is already already stretched and non-linear, providing the high contrast needed to act as an effective mask).
2. Producing Masks by Extracting Lightness from Colour Images
+ Works equally well with linear and non-linear images.
+ Can be produced with very little effort.
+ Provides varying degrees of protection depending on brightness of image across different areas, which is perfect for overall noise reduction.
+ Includes everything - stars, nebulosity and galaxies.
- Is not selective of particular structures of interest as it is a simple duplicate.
Masks work best when they are simply monochrome images. If you are already working with a colour image, you will need to extract a monochrome Lightness image from this to use it as a mask. You may have a colour image because:
+ Can be produced with very little effort.
+ Provides varying degrees of protection depending on brightness of image across different areas, which is perfect for overall noise reduction.
+ Includes everything - stars, nebulosity and galaxies.
- Is not selective of particular structures of interest as it is a simple duplicate.
Masks work best when they are simply monochrome images. If you are already working with a colour image, you will need to extract a monochrome Lightness image from this to use it as a mask. You may have a colour image because:
- you captured it with a one shot colour CCD camera or a DSLR camera,
- you already colour-combined the Red, Green and Blue monochrome images into an RGB colour image,
- or you produced an RGB colour image out of narrowband monochrome images.
Your colour image may or may not have been colour-calibrated at this point - the process for extracting a Lightness image to act as a mask is the same regardless. We will first need to tell PixInsight that all three colour channels, Red, Green and Blue, from our RGB colour image are weighted equally and fully for extracting a Lightness image. This is done with the RGBWorkingSpace process.
Simply enter 1.000000 in all three boxes (for Red, Green and Blue) or slide the sliders all the way to the right. Once done, click the circle Apply Global button and close it.
We now use the ChannelExtraction process, set to CIE L*a*b* mode.
Since we are only interested in extracting the Lightness from this image, we disable a and b and leave only L enabled. Once done, click Apply.
Since our RGB colour image is still linear, the extracted Lightness image is linear as well. It has been auto-stretched in the third screenshot above to demonstrate its monochrome nature. This will be our mask image, but to maximise its effectiveness, it must be stretched permanently rather than auto-stretched, exactly like on section 1 above. We reset the auto-stretch here and then use the ScreenTransferFunction process to produce an auto-stretch by clicking its Auto Stretch button.
We will now need to transfer these stretch parameters stored in ScreenTransferFunction over to HistogramTransformation, which will produce the permanent stretch. To do this, open HistogramTransformation and then drag and drop the New Instance button from ScreenTransferFunction on to the bottom bar of HistogramTransformation.
We now click Reset on ScreenTransferFunction to remove the auto-stretch and click Apply on HistogramTransformation to apply the stretch permanently.
The ScreenTransferFunction and HistogramTransformation processes can now be closed and our Lightness monochrome image is ready to be used as a mask. Applying it to our RGB colour image shows a good level of protection depending on brightness in particular areas. Since the Lightness image was extracted with all three colour channels having their full and equal weighting, it represents a fair assessment of varying image brightness and can thus be used well as a mask.
This can be used as an extremely effective mask for noise reduction. You will have to invert the mask when it is applied in order to attack the background more than the high signal areas.
If your original image is already non-linear because it has been stretched, you can simply extract a Lightness image and not worry about stretching it as your mask image will already be stretched and therefore be instantly ready for use.
If your original image is already non-linear because it has been stretched, you can simply extract a Lightness image and not worry about stretching it as your mask image will already be stretched and therefore be instantly ready for use.
3. Producing Masks with StarMask
+ Works equally well with linear and non-linear images.
+ Excludes large structures very effectively and keeps only stars.
+ Can produce smooth stars for good varying protection from the star cores to the outer edges.
+ Able to produce star contours masks for pinching stars to reduce their size.
+ Can be effectively combined with other mask images for customising protection.
- Can involve a fair bit of tweaking to get the best results.
- Can at times be difficult to include some stars over very bright nebulosity or galaxy structures.
The StarMask process is very capable of producing mask images for use in the protection of stars, or perhaps to attack stars alone (e.g. for colour saturation or to reduce star sizes). Configuring this process is quick once you know what each parameters does and experiment for yourself. Below is our sample linear Luminance monochrome image, auto-stretched in PixInsight alongside the StarMask process:
+ Excludes large structures very effectively and keeps only stars.
+ Can produce smooth stars for good varying protection from the star cores to the outer edges.
+ Able to produce star contours masks for pinching stars to reduce their size.
+ Can be effectively combined with other mask images for customising protection.
- Can involve a fair bit of tweaking to get the best results.
- Can at times be difficult to include some stars over very bright nebulosity or galaxy structures.
The StarMask process is very capable of producing mask images for use in the protection of stars, or perhaps to attack stars alone (e.g. for colour saturation or to reduce star sizes). Configuring this process is quick once you know what each parameters does and experiment for yourself. Below is our sample linear Luminance monochrome image, auto-stretched in PixInsight alongside the StarMask process:
To produce a star mask image, we need to keep Working mode set to the default Star Mask. The first parameter, Noise Threshold, is very important. This defines the noise cut-off. If set too low, noise specks around the image can be picked up as if they were tiny stars. If set too high, valid faint stars will be ignored. The best way to set this parameter is to check your image with the Readout Preview. To do this, zoom in on your image, pan to a section with small, faint stars you would like to include in your star mask image and keep your left mouse button clicked. Do this over the core of the small, faint stars you wish to include.
Since the image is monochrome, the brightness parameter K shown in the Readout Preview gives us a value to aim for. This value or slightly, slightly below it will include stars like these in the star mask image generated. Obviously there is a chance that going for a value as low as 0.009 will include noise specks in your star mask image as well. This is something you can tweak - test it out and if unsuitable, increase it ever so slightly. While looking through your image with the Readout Preview, you can check how bright your noise specks really are.
If you are dealing with a colour image at this point, instead of just K, your Readout Preview will show three values, for R, G and B. These are the brightness levels corresponding to each colour channel. Choosing a Noise Threshold value from these is a little harder but you can choose to either use the smallest of the three given to you (R, G or B) or instead take an average of all three and use that. Alternatively, you may produce a Lightness image out of your colour image, as detailed in section 2, and use this Lightness image to produce your star mask image with StarMask.
On setting 0.009 in Noise Threshold for my image and keeping the rest at default, I apply the process to my image to see what comes up.
If you are dealing with a colour image at this point, instead of just K, your Readout Preview will show three values, for R, G and B. These are the brightness levels corresponding to each colour channel. Choosing a Noise Threshold value from these is a little harder but you can choose to either use the smallest of the three given to you (R, G or B) or instead take an average of all three and use that. Alternatively, you may produce a Lightness image out of your colour image, as detailed in section 2, and use this Lightness image to produce your star mask image with StarMask.
On setting 0.009 in Noise Threshold for my image and keeping the rest at default, I apply the process to my image to see what comes up.
Please note that whether or not your original image is linear, the star mask image produced by the StarMask process will be stretched, which is perfect as it is effectively ready for applying as a mask. Inspecting the image produced, StarMask has picked up a lot of stars, but it has seemingly missed a lot of the small, faint ones, at least from what we can see above. Closer inspection shows that these stars have actually been picked up but are very, very faint in the star mask image. A way to address this from the start is to re-adjust the Midtones setting on the StarMask process. If we decrease this, we effectively stretch the star mask image when it is produced. Values of 0.25 down to 0.1 tend to work well but you may wish to go as low as 0.05 to get the most stars out of it. Do not overdo it as some of the brighter noise specks in your original image picked up by StarMask will start to pop up.
The above represents an excellent star mask image to use to protect (or attack) stars in the image. If you find that the largest stars have been seemingly excluded from your star mask image, you will need to increase the Scale parameter slightly. A value of 6 or 7 may suffice but if it is too large, you may start to see nebulous structures pop up in your star mask image, especially if you stretch the image aggressively with the Midtones setting as I did above. Conversely, if you decrease Scale, you will ignore the larger stars. The default setting of 5 works very well for most star sizes but will normally not pick up very large stars in your images.
You may notice from close inspection of your star mask image that the stars may appear a little bit larger in the star mask image than in your original image. Though this can generally be helpful, due to the nice smooth protection of faint star halos and surrounding areas, you may wish to be more abrupt in how stars are protected (or attacked). Tweaking this is the job of the Structure Growth settings in StarMask. To get the largest stars picked up to increase in size further, increase the Large-scale setting. If you want to get the largest stars picked up to increase less in size, decrease the Large-scale setting, or set it to 0 to force these stars to maintain their original size.
You may notice from close inspection of your star mask image that the stars may appear a little bit larger in the star mask image than in your original image. Though this can generally be helpful, due to the nice smooth protection of faint star halos and surrounding areas, you may wish to be more abrupt in how stars are protected (or attacked). Tweaking this is the job of the Structure Growth settings in StarMask. To get the largest stars picked up to increase in size further, increase the Large-scale setting. If you want to get the largest stars picked up to increase less in size, decrease the Large-scale setting, or set it to 0 to force these stars to maintain their original size.
The star sizes have clearly been reduced. The exact same can be done with the smallest stars picked up by tweaking the Small-scale setting in the same way. The Compensation setting can also be used to tweak the small star sizes in the same way, though this setting can be left at the default of 2 most of the time. The Large-scale, Small-scale and Compensation settings would need to be tweaked in tandem with Midtones, to help bring out the stars. You could also use HistogramTransformation to actually stretch the star mask image after it is produced by StarMask. Since a Large-scale setting of 2, Small-scale setting of 1 and Compensation setting of 2 worked well for my image, I leave them at that.
Smoothness is another parameter that can be tweaked. This tweaks the harshness of the stars reproduced in the star mask image. If you decrease the value, you get stars that appear more abrupt, less smoothed out to the background and with sharper edges. This can be good to subtract the star mask image from another mask image, to effectively remove stars from the mask. Combining mask images is the subject of discussion of a later section. Generally, the default value of 16 works very well. Tweak this value as best suits your needs.
There are two important checkbox settings in StarMask that we need to cover. Enabling Binarize will turn anything picked up by StarMask into pure white - no soft transitions of any kind, either pure black or pure white. However, after this is done, the image is smoothed according to your Smoothness setting and this achieves some level of soft transitioning in your star mask image.
Smoothness is another parameter that can be tweaked. This tweaks the harshness of the stars reproduced in the star mask image. If you decrease the value, you get stars that appear more abrupt, less smoothed out to the background and with sharper edges. This can be good to subtract the star mask image from another mask image, to effectively remove stars from the mask. Combining mask images is the subject of discussion of a later section. Generally, the default value of 16 works very well. Tweak this value as best suits your needs.
There are two important checkbox settings in StarMask that we need to cover. Enabling Binarize will turn anything picked up by StarMask into pure white - no soft transitions of any kind, either pure black or pure white. However, after this is done, the image is smoothed according to your Smoothness setting and this achieves some level of soft transitioning in your star mask image.
The star mask image is clearly brighter overall, and this can be very good when wanting to be very protective of stars. As aforementioned, Smoothness may need to be increased to produce a nice smoothed out mask image. You will notice I had to raise Noise Threshold to 0.1 for my above result. This happens because anything picked up by StarMask is binarised with this setting enabled, meaning it was turning the very, very faintest noise specks picked up into pure white pixels before smoothing. The end result was a pretty plain white image due to the aggressive 0.009 Noise Threshold setting I was using prior.
The other important checkbox setting in StarMask is Contours. Enabling this will not produce a star mask image - it will produce a star contours mask image. Smoothness will need to be decreased significantly however, as otherwise the contours produced are smoothed out too much and they end up looking like actual stars. Generally, Large-scale and Small-scale should also be reduced, or set to 0, as this will ensure that the star contours produced are indeed the size intended and will not be smoothed out either.
The other important checkbox setting in StarMask is Contours. Enabling this will not produce a star mask image - it will produce a star contours mask image. Smoothness will need to be decreased significantly however, as otherwise the contours produced are smoothed out too much and they end up looking like actual stars. Generally, Large-scale and Small-scale should also be reduced, or set to 0, as this will ensure that the star contours produced are indeed the size intended and will not be smoothed out either.
Notice again that Noise Threshold has been increased to 0.1 to get the star contours mask image produced above. This was necessary to circumvent producing contours around everything, including noise specks. The following is a zoomed in section to show the star contours:
This kind of mask is very useful for reducing star sizes. The contours effectively pinch the stars to reduce their size inwards.
Generally speaking, a star mask can be very, very useful and no doubt you will require one at some point. Protection of stars from application of certain processes can be critical.
Generally speaking, a star mask can be very, very useful and no doubt you will require one at some point. Protection of stars from application of certain processes can be critical.
One final note for using StarMask is that when the original image you are trying to create a star mask image for is stretched (non-linear), the same settings may not apply. Specifically, Noise Threshold will change dramatically and you would need to review your image to get a good setting for it. The default of 0.1 works well with most stretched images but you may need to indeed increase it to 0.15 or even 0.2 to really exclude noise and bright nebulous structures, and only include stars.
Either way, we can see that StarMask is both a very powerful and a very customisable process, despite the relatively few options it presents when we open it. These masks are extremely useful on their own or in combination with other masks, either to add star protection or remove it.
Either way, we can see that StarMask is both a very powerful and a very customisable process, despite the relatively few options it presents when we open it. These masks are extremely useful on their own or in combination with other masks, either to add star protection or remove it.
4. Producing Masks with RangeSelection
+ Can be produced with little effort.
+ Provides varying degrees of protection depending on brightness of image across different areas.
+ Includes everything - stars, nebulosity and galaxies.
+ Very effectively excludes background completely, depending on user parameters.
+ Can be selective in what is really included, but this depends solely on brightness.
- Cannot exclude stars by itself, making using this unsuitable for nebulosity contrast enhancement (if used by itself).
- Only viably works on non-linear (stretched) images.
RangeSelection is an excellent process to produce mask images from simple brightness information across the image, with nice smoothed transitions between fine details. The trouble is that because of how it works (selecting out brightness values), it seldom works with linear images and requires you stretch your image to non-linear prior to using RangeSelection. The following is a stretched non-linear Luminance monochrome image open in PixInsight with RangeSelection open beside it:
+ Provides varying degrees of protection depending on brightness of image across different areas.
+ Includes everything - stars, nebulosity and galaxies.
+ Very effectively excludes background completely, depending on user parameters.
+ Can be selective in what is really included, but this depends solely on brightness.
- Cannot exclude stars by itself, making using this unsuitable for nebulosity contrast enhancement (if used by itself).
- Only viably works on non-linear (stretched) images.
RangeSelection is an excellent process to produce mask images from simple brightness information across the image, with nice smoothed transitions between fine details. The trouble is that because of how it works (selecting out brightness values), it seldom works with linear images and requires you stretch your image to non-linear prior to using RangeSelection. The following is a stretched non-linear Luminance monochrome image open in PixInsight with RangeSelection open beside it:
This process pretty much requires we use the Real-Time Preview to make best use of it, so we enable this.
By default, everything will appear white as the default range of Lower limit at 0 and Upper limit at 1 includes the entire image. These settings define how much of the image is taken into account for the mask image. The way to customise it is to slide the Lower limit slider to the right bit by bit (or enter slightly larger values each time).
As you do this, you will notice more and more areas of the image turn black and you see the detail in your object pop out. If you go too far, everything will turn black. As it stands however, the mask image is pretty sharp and sharp images seldom make good masks as smooth transitions between features is a good thing. To do this, we simply increase the Fuzziness and Smoothness settings. The following is with Fuzziness set to 0.15 and Smoothness set to 5:
After you tweak Fuzziness and Smoothness, you may need to tweak Lower limit further to include some extra details (by decreasing Lower limit slightly). Experiment with the three settings to get a mask that shows you what you want to protect (or attack), for whatever purpose you wish to use this mask image for.
Once you are happy, close the Real-Time Preview window and apply the process to your image to produce the mask image.
You may notice that the brightest stars' cores are black due to your setting of Fuzziness. This setting is good to use to smooth out the fine details in your mask image to produce more varying degrees of protection, but it has the disadvantage of excluding some saturated areas such as bright star' cores. This is easily fixed by combining it with a star mask image however, and this is a subject of the next section.
The following shows how well this mask can protect low signal areas such as background, or high signal areas such as bright nebulosity and stars.
The following shows how well this mask can protect low signal areas such as background, or high signal areas such as bright nebulosity and stars.
A final note about using RangeSelection is that if your image is linear and you would like to use RangeSelection, you could simply duplicate your image, apply the auto-stretch parameters as a permanent stretch using HistogramTransformation and then create your mask image with RangeSelection on this non-linear duplicate. The mask image can then be applied to your linear image all the same. Essentially, you can apply the techniques covered in sections 1 and 2 above to give you a non-linear monochrome duplicate for creating your mask image.
5. Modifying and Combining Masks for More Targeted Application
+ Depending on what is used (i.e. not RangeSelection), can work with linear and non-linear images.
+ Can combine multiple, very different, mask images into one that is more effective to the task at hand.
+ Can provide the benefits from multiple types of mask images, such as varying degrees of protection and exclusion of stars.
+ Extremely effective at getting the job done, depending on user effort.
- Depending on requirements, can take considerable effort to construct.
At times, mask images in their own right are not perfectly suitable for our application. They may require modifying or combining with other mask images to produce something we can really use for what we want to do. This section covers a number of different modifications one can apply to mask images and how we can combine masks images to produce a single, more suitable mask image.
To cover much of the techniques, let us propose a situation. You have an image that you wish to enhance contrast in the nebulosity alone. For this, you produce a mask image with RangeSelection to select out the brightest parts of nebulosity, but this unfortunately includes stars as well. We simply create a star mask image with StarMask, subtract it from our RangeSelection mask image and we are done. However, a few large stars remain above nebulosity that you want to exclude, so we simply paint over them with CloneStamp to remove them and once done, we blur the combined mask image to give smooth transitions.
Let us start with the image we want to create a mask for. This is a non-linear monochrome image:
+ Can combine multiple, very different, mask images into one that is more effective to the task at hand.
+ Can provide the benefits from multiple types of mask images, such as varying degrees of protection and exclusion of stars.
+ Extremely effective at getting the job done, depending on user effort.
- Depending on requirements, can take considerable effort to construct.
At times, mask images in their own right are not perfectly suitable for our application. They may require modifying or combining with other mask images to produce something we can really use for what we want to do. This section covers a number of different modifications one can apply to mask images and how we can combine masks images to produce a single, more suitable mask image.
To cover much of the techniques, let us propose a situation. You have an image that you wish to enhance contrast in the nebulosity alone. For this, you produce a mask image with RangeSelection to select out the brightest parts of nebulosity, but this unfortunately includes stars as well. We simply create a star mask image with StarMask, subtract it from our RangeSelection mask image and we are done. However, a few large stars remain above nebulosity that you want to exclude, so we simply paint over them with CloneStamp to remove them and once done, we blur the combined mask image to give smooth transitions.
Let us start with the image we want to create a mask for. This is a non-linear monochrome image:
We first use RangeSelection to produce a mask image encompassing only the brightest bits of nebulosity, since it is these we want to enhance contrast in.
Notice that it has not been aggressively smoothed (Smoothness is only set to 2). This is because we are going to blur the image later anyway. We set this RangeSelection mask image to the side for later use. For now, we would like to exclude stars from the contrast enhancement, both those over the bright nebulosity and those outside roaming around the background. For this, we use StarMask on our original image.
At default, the star mask image appears a little faint so we can stretch out the histogram with HistogramTransformation.
In order to maximise the effect of subtracting this star mask image from the RangeSelection mask image, we can use MorphologicalTransformation to dilate the stars a bit and increase their overall size. The best Operator for this is Morphological Selection so we select this.
To produce better results, let us increase the size of the filter applied and make it more star-shaped. To do this, select 5 (25 elements) from Size and click the top, bottom, left and right three black squares to make a star-shape as shown below:
If you make a mistake, you can keep your CTRL key pressed and click on a square to make it black again. Once done, we draw our attention to the Selection setting. A setting of 0.50 does nothing to the star sizes. A setting lower than 0.50 decreases star sizes and a setting higher than 0.50 increases star sizes. The Morphological Selection operator is a combination of Erosion and Dilation (it applies both in tandem with different strengths to produce a more smoothed out end result that is more dilated than eroded, or more eroded than dilated). Selection set to lower than 0.50 essentially erodes more than it dilates and conversely, a setting higher than 0.50 dilates more than it erodes. You generally want to avoid extreme values like 0 or 1 in favour of decimals to produce some level of dilation and erosion as the combined effect is smoother.
We set a value of 0.75 and increase Iterations to 3. Amount can be tweaked to something like 0.50 if you would like the end result to be a 50% blend between the original image and the modified image. 0.30 would blend 30% of the modified image with 70% of the original image. Since this is only a mask image, we keep Amount at 1.
We set a value of 0.75 and increase Iterations to 3. Amount can be tweaked to something like 0.50 if you would like the end result to be a 50% blend between the original image and the modified image. 0.30 would blend 30% of the modified image with 70% of the original image. Since this is only a mask image, we keep Amount at 1.
The effect on the star mask image is clear - the star sizes have been smoothly increased. With our star mask image ready, we set it aside and open PixelMath, which will be used to combine both mask images into one.
As we wish to create an entirely new image from combining both mask images, we select Create new image and then select Grayscale from Color space. In RGB/K, we type in the operation we wish to carry out - subtracting the star mask image from the RangeSelection mask image:
range_mask - star_mask
This then produces the following new combined mask image once we click Apply:
With the majority of the stars over background now gone, we concentrate on removing the most pronounced stars that are over nebulosity that were not picked up by StarMask. You will find the more pronounced stars already have a black circle present within the nebulosity, but this exclusion zone is seldom enough as they only normally represent the cores of the stars, rather than the whole star and its surrounding halo (even if small). We will now use CloneStamp to cut segments out of the combined mask image - to produce a larger black mark where the pronounced stars are for better protection.
For this, we will have to zoom in and pan around the image quite a bit. We inspect a fair bright star we want to remove.
We will clone a black area of the image over this star. To do this, keep CTRL pressed and click an area that is purely black. It does not need to be nearby - you can zoom out and do it somewhere else entirely. The default Radius of 5 is very small for this star so I increase it to 30. Now we simply make some clicks here and there to remove the area that corresponds to this star.
Do not worry about the harsh transitions introduced by doing this. We will blur the entire combined mask image before application so these transitions will be smoothed out nicely. Once happy, click the Execute button on CloneStamp to apply the operation to your image. You can continue on your panning mission to find more problematic stars to remove. You may have to change the Radius to something larger or smaller depending on your application of CloneStamp.
We now deal with some of the more pronounced stars over bright nebulosity. We know where they are because they show up as black circles within the bright nebulosity. These black circles correspond to their cores, but we need a larger exclusion zone for them for adequate protection.
Since there is no nearby black area, we need to zoom out and do our CTRL click selection for cloning outside this area. Once done, we set an appropriate Radius to approximately double the size of this black circle, we aim at the centre and perform a single click.
We repeat this process for the more pronounced stars around our bright nebulous areas of the image until we feel we have sufficient star protection. Make sure to click Execute periodically to apply the changes to your combined mask image.
With better overall protection of stars and more focus on the bright nebulous areas of the image, we now proceed to smooth out the combined mask image to remove the harsh transitions introduced by our modifications. The process of choice here is ATrousWaveletTransform.
As PixInsight works with wavelet layers for images, with each increasing layer number representing structures that are increasingly larger in pixel size, all we need to do to blur the image is delete the detail on the smallest wavelet layers. To do this, we leave Layers set to the default of 4 and simply select each one and disable Detail Layer for all four numbered 1, 2, 3 and 4. You can also double-click on the green tick next to the layer numbers to disable them, which turns these into red crosses. Make sure you keep the R (residual) layer enabled as this represents the rest of the wavelet layers we have not addressed. Applying this process will delete the detail on the smallest scale structures but keep the largest scale structures intact.
Feel free to apply the process two or even three times to get adequate blurring and better varied protection from the combined mask image.
The above result is from applying ATrousWaveletTransform with these settings twice successively. This combined mask image is now ready for applying as a mask to our image.
What we see here is very adequate protection for background and pronounced stars, including those over nebulosity, while allowing us to attack the bright nebulous areas. This kind of mask is excellent for getting that extra contrast on bright nebulous or galactic areas of an image without adversely affecting the background or stars, including those stars over areas of interest. It requires some work to produce, but the end result is generally worth the trouble.
Finally, and taking a side step from the above workflow, we move on to a simple modification that can be done to mask images to make their protection function more pronounced. Imagine for now that we have followed section 1 or 2 and produced a non-linear monochrome duplicate (or Lightness) image to act as our mask image. HistogramTransformation has a nice function where it can clip the shadows and highlights to make everything more pronounced. We first open the process and select our mask image from the list.
Finally, and taking a side step from the above workflow, we move on to a simple modification that can be done to mask images to make their protection function more pronounced. Imagine for now that we have followed section 1 or 2 and produced a non-linear monochrome duplicate (or Lightness) image to act as our mask image. HistogramTransformation has a nice function where it can clip the shadows and highlights to make everything more pronounced. We first open the process and select our mask image from the list.
The two buttons we are interested in are Auto clip shadows and Auto clip highlights. We click both and the black and white points on HistogramTransformation change respective to the histogram being displayed.
Clicking Apply shows us the more pronounced mask image produced by clipping shadows and highlights.
This can protect the high signal areas more effectively as they are more spread out from the background, which in itself is made quite black. As a result of this, the resulting mask image can be extremely effective for initial noise reduction on the background areas of an image.
As a closing remark, we strengthen the idea that masks are critical to one's post-processing of an image. The processes and techniques presented here will produce all sorts of masks that are applicable to almost, if not any image, depending on the user's parameters for producing them.
Comment Box is loading comments...