Making Starless Masks

Often when processing an image the stars will overwhelm the deep sky object as the image is stretched. There are several ways to handle this including reducing the stars after the stretches, but this approach works by limiting the stretches to the background and the DSO by using a mask to limit the effects of the stretch. The example below uses Paint Shop Pro, but the method works equally well in Photoshop or Gimp.

Step one is to produce a luminance mask of the image as shown below. Throughout the rest of the text this will be called the original image.

 
  1. Step one is to make a star mask using your favorite technique.
  2. Now make a layer stack with two layers of the original image.
  3. Apply the star mask to the top layer and set its combine mode to subtract or difference.

The layer stack is shown below  

Here is the resulting image which will be called Original Minus Stars 

 

Now the task is to fill in the holes where the stars used to be with the average value around each star. To do this we produce an image that gives us this data by taking the original and eroding away the stars.

  1. Use a couple of iterations of erosion
  2. Clone out any remaining stars taking your time to get as many of the remaining stars as possible
  3. Use a gaussian blur to smooth the result and produce an image that contains the average level around the stars. Experiment with the amount of blur required and always use the minimum amount that smooths out the erosion artifacts.

This produces the image below. This will be called Image A

 

Finally you need to combine Image A with the Original Minus Stars image.

  1. Creat a stack with the Original Minus Stars image on the bottom and Image A on top 
  2. Apply the star mask you made earlier to the top layer as shown in the stack below

 

This produces an image with the star holes filled in from Image A

 

Now use the healing tool or the clone tool to remove the rings left from the brighter stars and blur the result to smooth the final image. Only use enough blurring to smooth the image a bit leaving as much detail as possible.

The final mask without any stars is shown below.