ClarkVision.com

To Clarkvision.com Galleries
Home Galleries Articles Reviews Best Gear Science New About Contact

Astrophotography Image Processing:
Messier 8 and Messier 20 Image Stretching with the
rnc-color-stretch Algorithm

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:


Contents

Introduction
M8 + M20
Download
Conclusions


All images, text and data on this site are copyrighted.
They may not be used except by written permission from Roger N. Clark.
All rights reserved.

If you find the information on this site useful, please support Clarkvision and make a donation (link below).


Introduction

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.

M8 + M20

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.


Figure 1. Stacked input image. Nineteen 1-minute images made with a 300 mm f/2.8 lens and stock 7D Mark 2 digital camera.


Figure 2. Rnc-color-stretch automatically determined the sky level and subtracted the sky to make the lower left side of the histograms line up.

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).


Figure 3. Result from power stretch, power factor = 5.0, before new offset subtraction.


Figure 4. Data from Figure 3 with 1st pass at estimating the sky level.


Figure 5. Data from Figure 3 with 2nd pass at estimating the sky level.


Figure 6. A second pass at stretch with power factor = 5


Figure 7. Data from Figure 6 with 1st pass at estimating the sky level.


Figure 8. Data from Figure 6 with 2nd pass at estimating the sky level.

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.


Figure 9. Data from Figure 8 with color that is in the original input image (Figure 2) restored and enhanced 20%.

Finished gallery image: M8, the Lagoon Nebula and M20, the Trifid Nebula, 2015

Download

The rnc-color-stretch software is free and open source. You can download it from
8a) Software for nightscape and astrophotographers in this series.

Conclusions

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.


If you find the information on this site useful, please support Clarkvision and make a donation (link below).


References and Further Reading

Clarkvision.com Astrophoto Gallery.

Clarkvision.com Nightscapes Gallery.

The Night Photography Series:


Home Galleries Articles Reviews Best Gear Science New About Contact

http://www.clarkvision.com/articles/astrophotography-rnc-color-stretch-m8+m20/

First Published November 28, 2016
Last updated November 28, 2016