Misti Mountain Observatory - Astronomy Pages
Galaxies
Nebulae
Star Clusters
Solar System
7" Refractor
Film
Equipment
Site
Home

Image Processing Example - m8 (Lagoon Nebula)
The following steps illustrate the processing of an image of m8, beginning with calibrated image frames, and ending with a finished image ready for web display. Please be aware that what follows is One way to process this image. There are as many other legitimate (some much better) procedures as there are other image processors.

Each of the image thumbnails in the right column can be clicked to reveal a full-screen image. After displaying a full-screen image, use your browser's "back" button to return to this page.

This processing example uses the following software packages:

  • CCDSharp (Freeware available from SBIG)
  • MaxIm DL (Software available for purchase from Diffraction Limited)
  • Photoshop CS (Software available for purchase from Adobe)

Where links appear in the text below, it generally leads to another page which contains a detailed explanation of the steps necessary to carry out the indicated activity.

Step 0: Images ready to process
These image files were taken with an Optical Guidance Systems 32" Ritchey-Chretien telescope and SBIG STL-11000m camera, from very dark and transparent skies in northwestern Arizona.

The raw files have been calibrated (i.e., Dark Subtracted, Flat Fielded, Hot/Cold Pixels removed), and aligned with each other.

These files are available to interested users who wish to follow along with their own software, and/or make their own alterations to the process.

Luminance File.

This file is an added stack of 26 sub-frames, each exposed for 1 minute, unbinned, through an SBIG Clear filter.

Hydrogen-Alpha File.

This file is an added stack of 5 sub-frames, each exposed for 15 minutes, unbinned, through an Astrodon Hydrogen-Alpha filter.

Red File.

This file is an added stack of 9 sub-frames, each exposed for 1 minute, unbinned, through an SBIG Red filter.

Green File.

This file is an added stack of 9 sub-frames, each exposed for 1 minute, unbinned, through an SBIG Green filter.

Blue File.

This file is an added stack of 9 sub-frames, each exposed for 1 minute, unbinned, through an SBIG Blue filter.

Step 1: Deconvolve Luminance and Hydrogen-Alpha Files
The Luminance and Hydrogen-Alpha files are going to be providing the fine detail in the finished image. Since the sampling scale with the 32" RC telescope and STL-11000m camera yields about .32 arc-seconds per pixel, these images are what imagers call "over-sampled."

Generally, this means that they can benefit by some degree of deconvolution, which will tighten up the star images and other details in the image.

Use CCDSharp to do a 3 iteration Richardson-Lucy Deconvolution on the Luminance Frame. Luminance file shown after deconvolution at right.
Use CCDSharp to do a 3 iteration Richardson-Lucy Deconvolution on the Hydrogen-Alpha Frame. Hydrogen-Alpha file shown after deconvolution at right.
Step 2: Non-Linear Stretch of Luminance and Hydrogen-Alpha Files
Astronomical image data generally has most of the interesting signal in the lower part of the range of possible pixel values. While a few stars may have saturated cores, the vast majority of the nebulosity or galaxy detail is not very bright.

As an example, a raw Luminance file is shown on the right with a screen stretch of zero to 65536 (64k), the full range of this camera. If the image were transferred into Photoshop in this form, this is what it would look like.

Use MaxIM DL to do a Non-Linear Stretch (DDP) on the Luminance Frame, with DDP parameters:
  • Background = 2600
  • Mid-Level = 6000

Luminance file shown after non-linear stretch at right.

Use MaxIM DL to do a Non-Linear Stretch (DDP) on the Hydrogen-Alpha Frame, with DDP parameters:
  • Background = 2000
  • Mid-Level = 9000

Luminance file shown after non-linear stretch at right.

Note that I've done the non-linear stretches so that the background areas of the Luminance frame are somewhat brighter than the background areas of the Hydrogen-Alpha frame, while the highlights in the Hydrogen-Alpha frame are somewhat brighter than the highlights in the Luminance frame.

When these frames are combined in Photoshop, I'll be using the brightest portions of both frames, which will allow me to retain the subtle detail and star information from the Luminance frame, while also keeping the dramatic highlights from the Hydrogen-Alpha frame.

Step 3: Color Combine Red/Green/Blue frames and do Non-Linear Stretch on result
In MaxIm DL, load all three color files and select Color | Combine Color.

Set the color mixing ratio for each filter. These values can be determined experimentally, by reference to other users of the same filter/camera combination, or by doing a G2V star calibration.

The values I used for this data set are:

  • 1.35 - Red
  • 1.00 - Green
  • 1.60 - Blue

Note that I have checked the Bgd Auto Equalize button.

This is the result after the above Color Combine was executed.

Note the relatively low values that have to be used on the Screen Stretch in order to be able to see the details in this image. Some imagers prefer to load the RGB image into Photoshop in this form and bring up the color with Levels and Curves, but I prefer to do a non-linear stretch in MaxIm DL.

Use MaxIM DL to do a Non-Linear Stretch (DDP) on the RGB Frame, with DDP parameters:
  • Background = 2150
  • Mid-Level = 3000

RGB file shown after non-linear stretch at right. Note that the color here seems a bit washed out, but we'll deal with that in Photoshop below.

Save this file as a TIFF file in 16-bit uncompressed form.

Step 4: Combine Luminance and Hydrogen-Alpha frames in Photoshop
The Luminance frame shows great detail in the dim regions and stars, while the Hydrogen-Alpha frame shows interesting detail in the highlight areas. What we want is a merger of these two frames, keeping the best of both of them.

Load both frames into Photoshop.

Click on the Hydrogen-Alpha frame to make it active. Copy its contents:
  • Menu selection Select | All or keyboard-shortcut Ctrl-A
  • Menu selection Edit | Copy or keyboard-shortcut Ctrl-C

Click on the Luminance frame to make it active. Paste the Hydrogen-Alpha frame onto it:

  • Menu selection Edit | Paste or keyboard-shortcut Ctrl-V
Maximize the size of the Hydrogen-Alpha Window:
  • Menu selection View | Fit on Screen or keyboard-shortcut Ctrl-0

Note that at this point, all we can see is the Hydrogen-Alpha data. The Luminance frame is hidden in a layer beneath it.

Change the blend mode to Lighten. This has the effect of showing the brightest portion of each frame. It allows the stars and dim backround of the Luminance frame to show through, and keeps the highlights from the Hydrogen-Alpha frame.
Flatten the layers to make the merger permanent:
  • Menu selection Layer | Flatten Image (no keyboard-shortcut available)

Click on the Hydrogen-Alpha frame and close it, as we won't need it again during this processing run.

Step 5: Reduce Background Noise using Inverted Layer Mask
At this point, there is generally some noise in the low-signal areas of the image.

The image at right shows some minor noise (magnified to 100% viewing level).

We can blur this noise, but want to protect the stars and other details from the effect of the blur process.

One method of doing this is to use an Inverted Layer Mask to protect the brighter portions of the image, as described below.

First, create an Inverted Layer Mask for the image.
We want additional protection to the bright areas, so we'll now darken the darkest parts of the layer mask with Levels.

Invoke the Levels dialog box:

  • Menu selection Image | Adjustments | Levels or keyboard-shortcut Ctrl-L

Change the Input Levels in the Levels dialog box to 150, 1.0, 225. The 150 darkens the darker areas, while the 225 lightens the lighter areas. These parameters, of course, can be chosen to obtain the desired effect.

Since the Inverted Layer Mask itself is derived from our image, it contains the same level of noise in the background areas. It's best if we slightly blur the Layer Mask before proceeding.

Invoke the Gaussian Blur dialog box:

  • Menu selection Filter | Blur | Gaussian Blur (no keyboard-shortcut)

Use a blur radius of about 1 or 2 (2 was used here).

Now, make the top layer image active by clicking on its icon (circled in red at the bottom right in the image). Magnify it enough to clearly see the noise in the background area so that you can monitor the effect of the following blur command. (To magnify, press Ctrl-0, then press Ctrl-+ several times.)

Invoke the Gaussian Blur dialog box:

  • Menu selection Filter | Blur | Gaussian Blur (no keyboard-shortcut)

Use a blur radius of 2.

To monitor and evaluate the effect of the Blur command, while the Gaussian Blur dialog box is still open, repeatedly click on the Preview checkbox to see the effect the blur is having. The background noise should be substantially reduced. The stars may be softened just a little bit, but that can be recovered with an Unsharp Mask action a little later.

Flatten the layers to make the masked blur permanent:
  • Menu selection Layer | Flatten Image (no keyboard-shortcut available)
Maximize the size of the image Window (remove prior magnification):
  • Menu selection View | Fit on Screen or keyboard-shortcut Ctrl-0

Step 6: Load RGB Image, Reduce Color Noise using Inverted Layer Mask
Load the non-linear stretched RGB image. Maximize the size of the RGB:
  • Menu selection View | Fit on Screen or keyboard-shortcut Ctrl-0

As in the Hydrogen-Alpha/Luminance image, there is generally some noise in the low-signal areas of the image.

The image at right shows some minor noise (magnified to 100% viewing level).

We can blur this noise, but want to protect the stars and other details from the effect of the blur process.

One method of doing this is to use an Inverted Layer Mask to protect the brighter portions of the image, as described below.

Create an Inverted Layer Mask for the image.

However, when you get to step D in that process, don't use the color image as the basis for the layer mask. Instead, use the Hydrogen-Alpha/Luminance image. It better represents which areas of the final image will in fact be background and which will be highlights: Substitute the following in Step D:

  • Click on the Hydrogen-Alpha/Luminance Image to make it active Copy its Contents:
    • Menu selection Select | All or keyboard-shortcut Ctrl-A
    • Menu selection Edit | Copy or keyboard-shortcut Ctrl-C
  • Click on the RGB Image to make it active Paste the Hydrogen-Alpha/Luminance into it:
    • Menu selection Edit | Paste or keyboard-shortcut Ctrl-V
We want additional protection to the bright areas, so we'll now darken the darkest parts of the layer mask with Levels.

Invoke the Levels dialog box:

  • Menu selection Image | Adjustments | Levels or keyboard-shortcut Ctrl-L

Change the Input Levels in the Levels dialog box to 100, 1.0, 225. The 100 darkens the darker areas, while the 225 lightens the lighter areas. These parameters, of course, can be chosen to obtain the desired effect.

Note that we can afford to be more aggressive with blurring the color (only) data, so we don't darken this layer mask as much as we did for the Hydrogen-Alpha/Luminance image.

Since the Inverted Layer Mask itself is derived from our image, it contains the same level of noise in the background areas. It's best if we slightly blur the Layer Mask before proceeding.

Invoke the Gaussian Blur dialog box:

  • Menu selection Filter | Blur | Gaussian Blur (no keyboard-shortcut)

Use a blur radius of about 1 or 2 (2 was used here).

Now, make the top layer image active by clicking on its icon (circled in red at the bottom right in the image). Magnify it enough to clearly see the noise in the background area so that you can monitor the effect of the following blur command. (To magnify, press Ctrl-0, then press Ctrl-+ several times.)

Invoke the Gaussian Blur dialog box:

  • Menu selection Filter | Blur | Gaussian Blur (no keyboard-shortcut)

Use a blur radius of 4.

To monitor and evaluate the effect of the Blur command, while the Gaussian Blur dialog box is still open, repeatedly click on the Preview checkbox to see the effect the blur is having. The background noise should be substantially reduced. Again, we can afford to be more aggressive blurring the color data as the fine detail will come from the Hydrogen-Alpha/Luminance layer. Just be careful not to blur so much that you lose color in the small stars.

Flatten the layers to make the masked blur permanent:
  • Menu selection Layer | Flatten Image (no keyboard-shortcut available)
Maximize the size of the image Window (remove prior magnification):
  • Menu selection View | Fit on Screen or keyboard-shortcut Ctrl-0

Step 7: Merge Hydrogen-Alpha/Luminance image into RGB image
Click on the Hydrogen-Alpha/Luminance image so make it active. Copy its contents
  • Menu selection Select | All or keyboard-shortcut Ctrl-A
  • Menu selection Edit | Copy or keyboard-shortcut Ctrl-C
Click on the RGB image to make it active. Paste the Hydrogen-Alpha/Luminance Image onto it.
  • Menu selection Edit | Paste or keyboard-shortcut Ctrl-V

Set the Blend Mode to Luminosity

The color is looking much too washed out, so we'll add a little Color Saturation at this point. More adjustments may be needed later after we get the brightness and contrast where we want them.

Click on the Background layer icon (circled in Red at the bottom right of the image). Adjust the Color Saturation level of the color layer:

  • Menu selection Image | Adjustments | Hue/Saturation or keyboard-shortcut Ctrl-U
  • Enter 30 into the Saturation box.
  • Click OK
Flatten the layers to make the merger permanent:
  • Menu selection Layer | Flatten Image (no keyboard-shortcut available)

Click on the Hydrogen-Alpha/Luminance frame and close it, as we won't need it again during this processing run.

Step 8: Final Adjustments/Tweaking Image
While some of what precedes this step depends on personal preferences of the imager, all of what follows gets very personal and subjective. At each step of the way, the imager decides what adjustments will move the image toward his/her final vision.
Apply mild Unsharp Mask:
  • Menu selection Filter | Sharpen | Unsharp Mask (no keyboard-shortcut)
  • Amount - 50%
  • Radius - 2.0 Pixels
  • Threshhold - 0 Levels

These entries will provide a very small boost in sharpness without invoking too large a penalty in artifacts. The main artifact to be concerned about is dark rings around stars that overlay nebulosity. Another artifact that can occur with too-aggressive Unsharp Masking is hard-edged stars, rather than more natural looking soft-edged stars.

The image appears too bright for my tastes here.

Apply Curves to increase contrast/darken dimmer areas:

  • Menu selection Image | Adjustments | Curves (no keyboard-shortcut)
  • Set one point and enter 64 for the Input and 44 for the Output. This point will darken the background.
  • Set another point and enter 190 for the Input and 190 for the Output. This point will keep the highlights from also getting darker.
The image appears to be more pink where I'm expecting to see reds.

Apply a Color Balance Adjustment:

  • Menu selection Image | Adjustments | Color Balance or keyboard-shortcut Ctrl-B
  • If we raise the Red level, the image brightens, which I don't want it to do. Therefore enter -15 in each of the Green and Blue Color Levels. This enhances the Red color and darkens the image slightly.
At this point, I want to go just a little darker in both background and highlights:

Apply Curves to darken image:

  • Menu selection Image | Adjustments | Curves (no keyboard-shortcut)
  • Set one point and enter 64 for the Input and 54 for the Output. This point will darken the background.
  • Set another point and enter 190 for the Input and 180 for the Output. This point will darken the highlights.
At some point before finalizing the image, it's a good idea to magnify it and look for tiny defects that can be fixed with the Clone Stamp. (See red-circled icon on toolbar on left side of image).

Clone Stamp Image Defects:

  • Select Clone Stamp Tool
  • Set a suitable Brush size - large enough to cover the defects, but small enough so as not to cover too much image at a time.
  • Alt-Click near a defect
  • Click over top the defect to copy the tiny part of the image from one location over the defect.
This adjustment could be done at any time, but the raw data files have North at the bottom, rather than the more conventional North at the top.

Rotate image 180 degrees.

  • Menu selection Image | Rotate Canvas | 180 degrees (no keyboard-shortcut)
The image has some lines and border issues due to the Hydrogen-Alpha image not being taken with exactly the same framing as the other frames.
Select the Crop tool from the toolbar (circled in red on the left side of the image). Outline the area that is within the border areas that aren't shared with the Hydrogen-Alpha image, and press the Enter key.
Step 9: Save the Results
Save a TIFF version of the image:
  • Menu selection File | Save As (no keyboard-shortcut)
  • Supply a name for the file (should be different from the RGB file in case you want to start over at some point).
  • Select None for Image Compression to maintain the highest quality of the finished image.
If you want to share the image on the web or via email, save a JPEG version of the image:
  • Menu selection Image | Duplicate (no keyboard-shortcut)
  • Menu selection Image | Mode | 8-Bits/Channel (no keyboard-shortcut)
  • Menu selection File | Save As (no keyboard-shortcut)
  • Supply a name for the file.
  • Select a Quality of 9 to maintain a high quality in the saved image.
Enjoy the image, and start planning the next one...