Being able to completely remove stars within astrophotography can help enhance faint features without inflating stars or for creating amazing images that highlights the flows of nebula.
Although these two images are the same, the starless version allows you to see more of the details hidden within the nebula. I have documented another approach for star removal. It does work with practice and patience. I am now working with the StarNet process within PixInsight.
Unfortunately, StarNet doesn’t work well for me. Plus, StarNet takes a really, really, really long time.
As you can see, StarNet really only got the small stars. With bigger stars, there is a lot of residual data.
I believe the issues with StarNet and my images is because I’m running an imaging rig (12 inch Meade Schmidt–Cassegrain at F/10) with a small field of view. This means my stars are big. They are not pinpoints of light.
But if I use the following workflow, I can get StarNet to work really well on my images, whether they are linear or non-linear.
Tip: This only works well when the images have already had noise reduction applied. Doing before noise reduction results in a lot of dark artifacts after star removal. The smoother the image, the better results.
I find that StarNet does a better job with my images if they are stretched. As I’m only using this image as guide, I can do a simple stretch using the Screen Transfer Function and Histogram Transformation
With the image select, hit the radioactive icon in the screen transfer function. This will apply a temporary stretch to the image. To make this stretch permanent, drag the triangle in the lower-left portion of the screen transfer function window into the lower bar area of the Histogram Transformation process window. Apply the Histogram Transformation settings to the image.
Because of my narrow field of view, and because I drizzle integrate my images, my stars consume a lot of pixels. StarNet seems to have trouble with this setup. But if I shrink my image, StarNet works really well. As an added benefit, by shrinking the images, StarNet runs really fast.
To shrink the image, run the PixInsight Integer Resample process.
With Integer Resample, I downsample my image with a factor of 4 or 6. I use the lowest number that gives me a good result. Plus, with my normal image, StarNet takes around 10 minutes to process. After running integer resample, StarNet take less than 2 minutes.
With my image stretched and downsampled, I’m ready to try StarNet. There isn’t much to change with StarNet.
What I’m mostly interested in capturing is the Star Mask.
As you can see, StarNet did a fantastic job removing the stars from my stretched and resampled image. Plus, I now have a excellent star mask. Unfortunately, because I down-sampled my image, I lost a lot of detail when zoomed in. So let’s use the star mask on the full-scale image.
Before we continue, we need to make a few small corrections to the star mask. StarNet removed the stars, but it also removed some of the brighter details around the nebula. This is seen within the star mask. To correct this, we need to use the Clone Stamp tool to remove those stars from the star mask.
To use this, reset the process, then set the radius size. As we want to completely eliminate the stars, set the softness to 0. This will remove any gradients from the edges.
Find a black area, hit CTRL+LeftMouse. This is the the area you copy from. Left mouse click on the area to paste to.
It’s a good idea to have the original image (with stars) and the star mask sitting on top of each other in the PixInsight window. Zoom into different sections of both images. Blink between the two images with Ctrl+PageDown. This will let you compare the star mask with the original. The mask should only contain stars. Use clone stamp to remove any bright nebula edges.
When down with Clone Stamp, hit the green check mark to apply the modifications.
SAVE the star mask to a file.
We need to grow the star mask file so it is the same size as our original image. This means we need to undo the initial integer resample by upsampling our image by the same amount that we downsampled earlier.
Unfortunately, after upsampling the star mask, the actual dimensions of the file might be slightly different than the original image. In my example, my two images have the following dimensions:
- Original Image: W: 9134, H: 6901
- Star Mask: W: 9132, H: 6900
Because these dimensions don’t match, I won’t be able to use the star mask. However, as I’m only off by 1 or 2 pixels, I will use crop to add them back in. This minor discrepancy will not impact the final image.
With the Crop process, select the star mask. Simply add pixels to appropriate side until the “target px” parameter matches the original image. Because I needed to add 2 pixels for the width, I split them up for right and left.
Although we have a great star mask, it still will not completely remove the stars from our image because the stars are too small and too pixelated due to using integer resample to increase the image scale. To correct this, we create a range mask from our star mask image.
Because we are applying this to our star mask, we need to keep the lower limit very low. You will have to type in the value as the slider will create a number that is too large. The star mask should only contain stars and we want to capture everything in the range mask. We increase the fuzziness slightly, which helps remove the pixilation from the integer resample upsample process. If you go too far, you will lose the smallest stars. Finally, we also increase the smoothness, which will increase the size of the stars and create a smooth transition between star and background.
Looking at the before/after, you can see how the stars increased in size slightly.
Now that we have a very good star mask, we can start removing stars. To do this, we apply our range mask to our image, making sure we protect the background and not the stars.
With the mask applied, we start the Morphological Transformation process.
We want to do the following:
- Operator: Erosion
- Interlacing: 1
- Iterations: 10 because this will take a few cycles to completely remove the stars.
- Amount: 1.00 because we don’t want to blend the before image containing stars with the after without stars.
We will most likely need to apply this multiple times to completely remove the stars.
Looking at these images closer, Pass 2 looks the best. The third pass adds dark spots, especially in the bottom left corner.
Another example shows how after one pass we’ve removed many stars but are left with a few bright areas. And after we do a second pass, we have many black spots. For this example, we stop after 1 pass.
We can eliminate the residual star matter with Multiscale Linear Transformation and Convolution.
Multiscale Linear Transformation
We will use Multiscale Linear Transformation to remove physical layers from or star-masked protected image. This will help eliminate bright spots from the leftover residuals from the morphological transformation process.
We want to increase the number of layers, which will allow us to be more specific as to how much detail to remove. Remember, we are only removing detail not protected by our star mask.
Enable live preview and start removing layers, starting at layer one. Continue until most of the star residuals are gone. If you remove too many layers, you will begin to see a negative impact on the image.
Although it sounds strange to do on an astrophotography image, but using convolution will help blur our image. Because we’ve remove the stars, what we are left with can often be dark structures. Convolution will help blur the residual areas.
With the star mask still applied to the image, use the convolution live preview. Slowly increase the standard deviation until the dark structures left behind by the star remove process disappear.
TIP: You might have to increase the size of the star mask slightly. To do this, apply Morphological Transformation to the star mask. Use Dilation with either one or two passes.
Removing stars from an image is tedious (especially when StarNet does not work correcty), but can generate some amazing final images.