It has been a while, but the blog has not been abandoned. I am just too busy starting new projects to finish the old ones.

I photographed both the 2017 and 2024 total solar eclipses with the intent of combining a big bunch of separate exposures into one visually pleasing image that ideally showcases faint coronal details and Earthshine on the Moon. It turned out this is no easy feat.

I had the data for both eclipses, but there was no publically available software to do the kind of processing I had in mind, so I started writing my own in Python. Miloslav Druckmüller, Hana Druckmüllerová, and associates have developed advanced methods for processing coronal imagery1234, but have not shared their implementation. However, they have published several scientific papers describing the methods, which I have used as a foundation.

I started looking into the topic already in 2017, but life got in the way several times, and any meaningful progress got put off, almost to the point of it being embarrassing. But now the tools are finally in such a shape that I can publish them and show some results. With the advent of AI tools, I see many new applications related to eclipse photography popping up, and my scripts might get superceded by them quite quickly. Time will tell.

What makes processing total solar eclipse photos so difficult?

Processing total solar eclipse images can be divided into two phases. First one being alignment and stacking of photographs with varying exposure times to increase both dynamic range and signal-to-noise ratio. The second one being filtering to enhance faint coronal details.

7 different exposures of the solar eclipse of 2024
Raw images of the eclipse with varying exposures. Shortest exposures show the innermost corona and prominences, while the longest exposures show the faint coronal streamers and the Earthshine. The inner corona is fully blown out in the long exposures.

Alignment and stacking are challenging, because the Sun, Moon, and the Earth all move during totality, but we still want to combine them into a single image where everything is stationary and not blurred by motion. Additionally the Sun is not directly visible during totality, so alignment must be done based on the corona, which has very low-contrast features and fairly low signal-to-noise ratio.

Some special filtering techniques are required to enhance the structure of the corona without inadvertedly accentuating background noise or the high-contrast edge of the moon, while allowing selective enhancement of radial and tangential structures of the corona.

Image alignment and stacking

The main focus is on aligning photos according to the solar corona. For the final image you may also want to align images according to the Moon and according to the stars to showcase both the Earthshine and stars in the image, but those are much simpler than doing it according to the corona, so we won’t go into much detail about those. The center of the moon can be found in the image with simple circle detection, and most astrophotography processing applications allow you to align images according to stars.

Druckmüller et al. propose aligning coronal structures using phase correlation12, based on the Fourier transform. When you have several images of the solar corona that differ from each other only by some offset and noise, they all have more or less the same frequency content. But importantly the phases of the frequencies change. By correlating the phase content, the offset of each image to a reference image can be found. This method is very resistant to random noise, and requires no high-contrast structures.

Single stretched exposure of the eclipse showing the corona and the Moon covering the Sun
A single stretched exposure.

Single exposure of the eclipse but filtered so that it only shows the low-contrast structure of the corona
Same exposure but masked and filtered for alignment. This image is also stretched for visualization purposes. In reality the mean value of the filtered image is around zero, with both negative and positive values. The light gray of the Moon and the background sky have a numerical value of zero.

The shortest exposures contain practically no signal from the outer corona, and the inner corona is fully saturated in the longest exposures, so there is very little common signal in these images that could be used for alignment. What I found worked pretty well was taking all the longest exposures that are not saturated, and stacking them together to produce a reference frame that has decent signal througout most of the corona. This produces a reference frame which most of the exposures can be successfully aligned to.

Once all the exposures have been aligned, they must be combined into one high dynamic range stack, which shows the full corona from the bright inner details to the faint outer structures, while maximizing signal-to-noise ratio. Like mentioned before, the Moon moves relative to the Sun and its corona during the eclipse. Naive high dynamic range stacking would break in areas that the moon traverses during totality and leave a blurred mess. To combat this, Druckmüller et al. propose124 selecting one reference image from the point in time that you want to represent in the final stack, and then during stacking for any pixels that overlap with the Moon in the reference frame, pick them directly from the reference frame. Pixels that contain the Moon in each non-reference frame are ignored. So in essence any pixels contaminated by the Moon are thrown away, and the Moon is taken from the reference frame. You can see the result of that in the image below.

High dynamic range stack of photos showing the corona all the way from the inner corona to the outer streamers
Color calibrated high dynamic range stack of exposures aligned according to coronal structures. Filtering emphasizes some of the random noise on the outer skirts of the image, but this can be mitigated in the compositing phase by blending images with and without filtering.

Because the Moon data comes from the single reference exposure, it is very noisy and must later be replaced with a stack of long-exposure images aligned according to the Moon to reveal the Earthshine.

Enhancing coronal structures

The solar corona consists of a very strong radial gradient, and very low-contrast structures inside that gradient. To top it off, it terminates in the sharp edge of the Moon. This makes it difficult to enhance the faint details in the corona with traditional unsharp masking or deconvolution without emphasizing things you didn’t intend to.

Druckmüller et al. propose a modified version of unsharp masking14, which relies on using a varying convolution kernel for blurring the image. The kernel is masked so it never contains pixels contaminated by the Moon. Druckmüller calls this partial convolution. Also the size of the kernel can be controlled both in the tangential and radial directions from the center of the Sun to enhance specific structures of the corona.

Even with partial convolution, the filtering emphasizes the edge of the Moon slightly because of the strong radial gradient of the solar corona. In my tools I mitigate this by fitting and removing a linear trend from the pixel values before convolution, and reapplying it afterwards. This way the large scale gradient does not bias the sharpening results. Another way of solving this would be to apply some kind of high pass filtering to the image before convolution. Below you can compare results between regular unsharp masking, and the enhanced Druckmüller method.

Two images, with the left one showing part of the moon edge and solar corona sharpened with normal unsharp masking, and the left with the improved method
Comparison of sharpening using regular unsharp masking, and the method proposed by Druckmüller et al.

HDR stack of photos showing the coronal details much better than the unprocessed stack
HDR stack with Druckmüller’s enhancement filter applied.

Druckmüllerová et al. also developed a more advanced filter called Fourier normalizing-radial-graded filter3, but it would have been much more complex to implement and the results weren’t as visually pleasing, so I only implemented the enhanced unsharp masking method outlined by Druckmüller and others.

Final touches

After all the above is said and done, we have a highly detailed image of the solar corona, an image of the Moon with a lot of atmospheric haze and optical glare, and a stack with everything else slightly blurry expect stars. For combining these elements I do not have a very scientific approach yet, and I did the composite in Photoshop.

Image with the Moon in the center, showing some surface details illuminated by light from the Earth
Stack of long exposures aligned according to the Moon to show the Earthshine illuminating the Moon surface. The red line is a cluster of hot pixels that ended up in the final stack as the moon drifted through the field of view.

The work in Photoshop was mainly some brightness and color adjustment, and masking, to ensure the different pieces fit together and look pleasing. I did not find a good way to remove the bright edges of the Moon in the Earthshine image. I experimented with many different approaches, but most of them led to unnatural looking results. You can see my current final result below.

Composite image of the total solar eclipse of 2024
Composite image of the total solar eclipse of 2024, photographed in Hot Springs, Arkansas. It shows faint details of the solar corona, while preserving the solar prominences and Earthshine illuminating the Moon surface.

When I have time and energy, I will try running the 2017 eclipse photographs through this same pipeline.

Python tooling

I built my own command-line tool for this job using Python, and shared the source code of GitHub. You can find the Git repository at https://github.com/naavis/eclipsetools/

If you are familiar with Python tooling, you should be able to install and run the tool by executing the following:

pip install tse-tools
tse-tools --help

The different sub-commands exposed by the command-line interface should map pretty nicely with the description of the process above. If you are looking into building your own tools, feel free to take inspiration from the code.

Bibliography


  1. Druckmüller, M., Rušin, V., & Minarovjech, M. 2006, “A New Numerical Method of Total Solar Eclipse Photography Processing,” Contributions of the Astronomical Observatory Skalnaté Pleso, 36, 131–148. ↩︎ ↩︎ ↩︎ ↩︎

  2. Druckmüller, M. 2009, “Phase Correlation Method for the Alignment of Total Solar Eclipse Images,” The Astrophysical Journal, 706, 1605–1608. doi:10.1088/0004-637X/706/2/1605 ↩︎ ↩︎ ↩︎

  3. Druckmüllerová, H., Morgan, H., & Habbal, S. R. 2011, “Enhancing Coronal Structures with the Fourier Normalizing-Radial-Graded Filter,” The Astrophysical Journal, 737, 88. doi:10.1088/0004-637X/737/2/88 ↩︎ ↩︎

  4. Druckmüllerová, H. 2014, Application of Adaptive Filters in Processing of Solar Corona Images, PhD thesis, Brno University of Technology, Faculty of Mechanical Engineering. ↩︎ ↩︎ ↩︎