Creating star trails with automatic sky glow removal

Creating star trail images is one of the easier astrophotography tasks there is, since it doesn’t require any messing about with tracking devices. You just set a camera to point skywards, with programmable remote control set to snap a few 100 images over a hour or more. There are then software programs which can merge the individual images together to create the final star trail. On Linux, I use a startrails plugin for GIMP to perform the merging of individual frames which is simple to use and works pretty well.

The basic star trail image with no sky glow adjustments applied

The basic star trail image with no sky glow adjustments applied

This is all very straighforward if you’re capturing images under ideal conditions, but life doesn’t always work out that way. The first thing people do is to add in dark frames, which are images captured with the lens cap on. These frames will record any hot pixels or general sensor noise that may be present. The startrail application will merge all the dark frames and then subtract the result from the light frames, removing the hot pixels from the final image.

When taking images in London though, there is a major problem with sky glow from the ever present light pollution. There are number of techniques for removing sky glow, with varying pluses and minuses. A simple way is play with the curves/levels to reduce the intensity of the background glow and/or use colour balance corrections to try and make it less noticeable. The problem with this is that the corrections will apply to the background sky, the stars themselves and any foreground objects uniformly. All too often the sky glow is not uniform, but in fact a gradient from top to bottom of the frame, meaning the results of curve adjustment show up the gradient

The basic star trail image with curve adjustments to reduce intensity of the sky glow. Due to the gradient, it is only possible to remove part of the sky glow

The basic star trail image with curve adjustments to reduce intensity of the sky glow. Due to the gradient, it is only possible to remove part of the sky glow

The overall goal is to produce a background that is completely black. This could be achieved if we are able to extract the background component from the main image and then subtract it, leaving just the stars behind. The layers feature in any photo editor can be used as mechanism for accomplishing this task.

If we make an assumption that sky glow is approximately the same in each frame, we can follow a simple series of steps to extract a reasonable approximation of the sky glow background. Start by opening one of the individual frames. Then select the menu option Filters -> Blur -> Gaussian Blur. The radius setting should be set to a large value such as 150px. The resulting image should now be a very smooth colour gradient just representing the sky glow background.

A single image frame blurred to leave just the sky glow background

A single image frame blurred to leave just the sky glow background

Copy this blurred image, and switch to the star trail image previously produced by the plugin. Create a new layer, paste the blurred image into it and anchor the floating selection. Finally change the layer mode to “Subtract”.

The final star trail image with the gaussian blurred sky glow subtracted

The final star trail image with the gaussian blurred sky glow subtracted

The final result above doesn’t have a completely black background because the sky glow we extracted is merely an approximation, but it should have a less significant colour cast, and lower overall intensity. A small adjustment of curves can further reduce the remaining glow:

The final star trail image with the gaussian blurred sky glow subtracted

The final star trail image with the gaussian blurred sky glow subtracted

While this is much improved, there are still some limitations with this technique. If the sky conditions were changing during the course of the image capture session, any single frame will not be so close to the average glow of the final image, so will either be over or under correcting the sky glow. Weather often plays a part, sending clouds through the scene during capture. Ideally one would simply wait for a clear day before capturing images, but not everyone has such a luxury of time. When some images contain clouds, the final image (as seen above) will have a quite uneven, patchy sky glow which is not easily removed with a simple subtraction layer.

Ideally one would subtract the sky glow from each individual frame before merging them to produce the trail. With 100’s of frames this is quite a tedious process, but since the GIMP startrails plugin is open source GPLv3+ licensed python code, we have the freedom to modify it. To that end I have created a fork which has the ability to perform automatic sky glow removal by applying the gaussian blur technique to each individual frame. This more than doubles the amount of time required to produce a star trail image, but the results are very satisfying indeed.

The star trail when sky glow has been subtracted from each individual frame before merging

The star trail when sky glow has been subtracted from each individual frame before merging

The only downside is that when there are foreground images present, they tend to get a halo around their edges. On the plus side, subtracting the sky glow from each individual frame has totally removed the clouds from the image. The background is a pretty dark gray, but not completely black. This can be tweaked with a little use of curves to produce the final image

The star trail when sky glow has been subtracted from each individual frame before merging, with curve adjustments at the edge

The star trail when sky glow has been subtracted from each individual frame before merging, with curve adjustments at the edge

One final tip is to run a guassian blur with a radius of 1.2px on the final image before saving. This will smooth out any jagged edges on the trails caused by the tiny gaps between successive frames.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.