by Roger N. Clark
Astrophotography image processing example with M2 and M20 and the rnc-color-stretch algorithm to produce a near-final result
The Night Photography Series:
M8 + M20
The rnc-color-stretch command to make the following images was:
rnc-color-stretch m8+m20.rnclark.c08.12.2015.19frames.test-c1b5x5.tif -rootpower 5 -rootiter 2 -obase m8+m20.test5-rs5-2itersc1e1.2 -enhance 1.2 -display -plots
The 16-bit tif image, m8+m20.rnclark.c08.12.2015.19frames.test-c1b5x5.tif, is available at the previous article in this series.
All the images and plots below were made by rnc-color-stretch automatically.
The algorithm reads the image and analyzes the histogram of each color (Figure 1). The first step is to determine the amount of skyglow to subtract to bring each color channel to the reference level and rnc-color-stretch does this automatically (Figure 2). This assumes there is an appropriate patch of black sky to determine the block point. If there is no such patch, the use must give an estimate of the color of the dark patch, and will be discussed in the next article in this series.
The next step rnc-color-stretch does is to apply the power stretch (Figure 3). Notice the image is brighter and more faint details can be seen. The sky level is re-established in Figures 4 and 5 in a 2-step iterative process. The command line indicated a 2-pass stretch (-rootiter 2 on the command line above). The second power stretch is applied in Figure 6. Notice how the histograms have been widened. The sky level is re-established in 2 iterations (Figures 7 and 8).
The final step is analyzing the colors in each pixel in the stretched image versus the original. Note because the original image is faint we can't easily see the colors. The stretching process, and this applies the the stretches in this algorithm and in general all stretching, compresses the image intensities at the high end, losing color. The rnc-color-stretch restores the color that was in the original image and lost in the stretch. That is shown in Figure 9 and is the final output image from the algorithm. In this case, the command line includes the -enhance 1.2 option so the colors were enhanced 20% over their originals.
Finished gallery image: M8, the Lagoon Nebula and M20, the Trifid Nebula, 2015
The rnc-color-stretch software is free and open source. You can download it from
8a) Software for nightscape and astrophotographers in this series.
The rnc-color-stretch algorithm automates the stretching process and can produce a final or close to final stretched astrophoto in many situations. Use the -display and -plots options to show the intermediate steps and histograms of the stretching process.
Optimal results from rnc-color-stretch depends on input parameters. I suggest making a small image, like that shown here, so the computation time is faster. Use the -jpegonly flag to minimize disk space of 16-bit png files. Explore different power stretches and the effects of the scurve1 and scurve2 flags. Once you find a set of parameters that works well with your image, then turn off the jpegonly flag and run it again to make the 16-bit png file.
References and Further Reading
Clarkvision.com Astrophoto Gallery.
Clarkvision.com Nightscapes Gallery.
The Night Photography Series:
First Published November 28, 2016
Last updated November 28, 2016