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.

Original Image
Original Image
StarNet Image
StarNet Image

As you can see, StarNet really only got the small stars. With bigger stars, StarNet does a very poor job.

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.

Stretch

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

Screen Transfer Function
Screen Transfer Function
Histogram Transformation
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.

Integer Resample

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.

 Integer Resample - Downsample
Integer Resample – Downsample

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.

StarNet

With my image stretched and downsampled, I’m ready to try StarNet. There isn’t much to change with StarNet.

StarNet
StarNet

What I’m mostly interested in capturing is the Star Mask.

Starless Image
Starless Image
Starmask
Starmask

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 downsampled my image, I lost a lot of detail when zoomed in. So let’s use the star mask on the full-scale image.

Clone Stamp

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.

Clone Stamp
Clone Stamp

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.

Integer Resample

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.

Integer Resample - Upsample
Integer Resample – Upsample

Crop

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.

Crop
Crop

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.

Range Mask

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.

Range Mask
Range Mask

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.

Initial star mask
Star Mask
Range Mask Star Mask
Range Mask Star Mask

Looking at the before/after, you can see how the stars increased in size slightly.

Morphological Transformation

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.

Star Mask Applied
Star Mask Applied

With the mask applied, we start the Morphological Transformation process.

Morphological Transformation
Morphological Transformation

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.

Baseline Image
Baseline Image
 Morphological Transformation Pass 1
Morphological Transformation Pass 1
Morphological Transformation Pass 2
Morphological Transformation Pass 2
 Morphological Transformation Pass 3
Morphological Transformation Pass 3

Looking at these images closer, Pass 2 looks the best. The third pass adds dark spots, especially in the bottom left corner. With the second pass, we still have some residual star matter. We will remove that with Convolution.

Convolution

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.

Convolution
Convolution
Convoluted Image
Convoluted Image

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.

Final Image

Removing stars from an image is tedious (especially when StarNet does not work correcty), but can generate some amazing final images.

Before Star Removal
Before Star Removal
After Star Removal
After Star Removal

Leave a Reply