Astrophotos plagued by light pollution? Here's how to clear them up in processing with free software

Astrophotos plagued by light pollution? Here's how to clear them up in processing with free software

Save 30% on the shop price when you subscribe to BBC Sky at Night Magazine today!
Published: June 30, 2025 at 9:22 am

For astrophotographers, gradients are a common problem, even if photographing from a dark site.

Caused by light pollution, either from artificial lighting or Moon glow, they make backgrounds look uneven and can particularly affect faint targets like nebulae.

How to transform your astrophotos with image processing. Credit: Farknot_Architect / iStock / Getty Images
Credit: Farknot_Architect / iStock / Getty Images

They can become more obvious when you stack your frames, detracting from fainter details. Thankfully, there are options to help.

The Rosette Nebula showing bad gradients radiating from left to right caused by light pollution. Credit: Ivana Peranic
The Rosette Nebula showing bad gradients radiating from left to right caused by light pollution. Credit: Ivana Peranic

Introducing Siril

Siril is a powerful, free processing program with a built-in gradient-removal tool called Background Extraction.

It’s best to remove gradients after stacking your image, before any stretching or processing.

We’ll therefore start with a freshly stacked image of the Rosette Nebula made from 105 sub-frames.

If your stacked result shows artefacts on the edges, it’s best to crop the image before using Background Extraction.

After using Siril’s Background Extraction tool to even out the gradients, the image is ready for further processing. Credit: Ivana Peranic
After using Siril’s Background Extraction tool to even out the gradients, the image is ready for further processing. Credit: Ivana Peranic

Getting started

To see the level of gradient you’re working with, choose ‘Histogram’ in the bottom-middle menu (see image below).

This will show an extremely stretched version of the image. This is a preview only and any changes won’t be permanently applied.

Now click the ‘Image Processing’ tab on the top menu and select ‘Background Extraction’. 

In the Background Extraction menu, there are several controls that will help perform the best background extraction according to the specific gradient in your image.

The first options are ‘Polynomial’ or ‘RBF’ (radial basis function) extraction.

Polynomial, with its strength options from 1 to 4, is recommended for very simple gradients.

However, since most gradients tend to rotate and overlap as your target moves across the sky, RBF is often the best option.

Open the Histogram view; this makes any light pollution far more obvious. Open Background Extraction and place points to select the background to be corrected
Open the Histogram view; this makes any light pollution far more obvious. Open Background Extraction and place points to select the background to be corrected

Select the background

The next three sliders allow you to automatically place a grid of points that determine the background in the image.

The ‘Smoothing’ parameter controls the level of transition between these points.

‘Samples per line’ allows you to choose the number of points automatically generated in a horizontal line.

‘Grid tolerance’ defines whether a sample point will be placed in an area of the image; the lower the tolerance, the more a bright area will be designated as detail and not background. 

Once these sliders are set, clicking ‘Generate’ will automatically place the points.

If your nebula only covers a small portion of the image, adding points automatically can be time-saving; just make sure the points stay well clear of nebulosity and bright stars. If you misplace a point, remove it with a right click. 

However, if the nebula covers a lot of the frame, you can add the points manually.

In my example, I captured the Rosette Nebula from a Bortle 4 site on the South Downs in the UK.

Despite the dark skies, there was a strong glow from Brighton’s city lights, revealed by the histogram preview.

Since the nebula took most of the frame, I added points manually. 

Starting in the corners away from the nebula, zoom in and left-click to place points to designate as background (see image below).

If it becomes difficult to distinguish which bits to avoid, cycle through the R, G and B layers in the upper tab, or switch from ‘Histogram’ to ‘Autostretch’ mode for a temporary, less aggressive stretch of the image.

Zoom in for better control as you place your points, to ensure you don’t cover any stars or nebulosity. Checking the view in the red, green and blue layers will help
Zoom in for better control as you place your points, to ensure you don’t cover any stars or nebulosity. Checking the view in the red, green and blue layers will help

Finishing up

As you get closer to the target, less is more.

You can add more points later if needed, but first you want to ensure you place points only on the background.

When the points have been placed, clicking ‘Compute Background’ will create an image with a corrected background.

This is not permanently applied to the image, so you can take away or add more points if more correction is needed.

Once happy with your result, click ‘Apply’ (see image below) and view the finished result in Autostretch mode.

Click ‘Compute Background’. Siril will generate a corrected image you can adjust further if needed. Once you’re happy, click ‘Apply’ to make the changes permanent
Click ‘Compute Background’. Siril will generate a corrected image you can adjust further if needed. Once you’re happy, click ‘Apply’ to make the changes permanent

3 quick tips

  1. If the brighter side of the gradient is too bright, place the points using Autostretch view
  2. Right-click the same point twice to remove it and its two closest points in a single move
  3. You can perform background extraction more than once, so be conservative when placing your first points

If you're an astrophotographer, whether complete beginner or seasoned expert, send us your images and they could appear in a future issue of BBC Sky at Night Magazine

This website is owned and published by Our Media Ltd. www.ourmedia.co.uk
© Our Media 2025