Separating Stars and Deep Sky Objects

Many times when processing astrophotographs it is difficult to increase the brightness of the deep sky object without over brightening the stars. This results in bloated stars that detract from the overall appearance of the image. As with most of the other processing techniques covered here, your favorite layer capable image editor can help to alleviate the problem. The example below uses Paint Shop Pro, but the method works equally well in Photoshop or Gimp.

First let's take a look at a stretched shot of the Witches Broom Nebula.




As you can see, the multitude of bloated stars in the field greatly detract from the image and obscure much of the faint red nebulosity and this is after a pass of star shrink processing in an attempt to minimize the problem. Compare this with the same data where the stars were separated from the rest of image before a stretch was applied to the nebula.


  Layer D

The results show much more of the faint red nebulosity throughout the image as it is no longer overwelmed by large bloated stars.

The algorithm is somewhat convoluted but fairly simple to implement using any layer capable image processor that supports the difference and lighten blend modes.

  1. First we proceed by separating the stars onto another layer. Duplicate the original image twice producing three layers. Label the top layer A, the next layer B and the bottom layer C.
  2. Now blur layer A with a gaussian blur of about 2 to 4 pixels. The idea is to make a slight difference in the brightness of the stars between layer A and B.
  3. Set the blend mode of layer A to difference. This will elliminate the deep sky object and leave a dim representation of the stars. Combine layer A and B and rename it D.
  4. Using curves, stretch layer D and then use thresholding to produce a clean black background with white stars. This layer is shown to the right.

Now for the fun part

  1. Using the magic wand select the background of layer D. Use a low tolerance and make sure that continuous selection mode is on so as not to select dark areas inside large stars.
  2. Invert the selection and expand it by about 4 pixels. In Paint Shop Pro this is done with the menu Selections, Invert and Selections, Modify, Expand
  3. Next feather the selection by 3 or 4 pixels. Again, in Paint Shop Pro this is done with the menu Selections, Modify, Feather
  4. This leaves a feathered selection around the stars in the image, save it to the alpha channel or disk. Delete layer D.
  5. Make layer C active with the selection in place and promote the selection to a new layer and call it E. This is now a layer containing only the stars in the image.
  6. Hide E, make C visible and active then use several passes of an erosion filter, or if using Photoshop use the minimum filter, to remove as many stars as possible. Cancel the selection and you are left with two layers: E with only the stars and C with the background and the deep sky object.

Now you can process each layer in what ever way you like to produce the result you are after. When you are done, switch the combine mode of the layer containing the stars to lighten and flatten the layer stack.