Removing Gradients

When imaging from the city, or when using extreme stretches, brightness gradients across the image can spoil an otherwise nice image. As with the other techniques covered here any layer capable image processor can correct this problem, at least in many cases. In order for this technique to work, the deep sky object must not take up a large part of the frame as the sky background is used to subtract out the gradient.

Let's start with an image that has a brightness gradient across the frame 

The idea here is to extract the gradient from the image and then subtract it from the original to leave the image without the gradient.

  1. First duplicate the image and call the top layer A and make it the active layer
  2. Clone out the brighter stars and any deep sky objects such as the tiny galaxies in the image
  3. Make several erosion filter passes to remove most of the dim stars
  4. Use a median filter with a very large radius to remove the remaining stars in the layer
  5. Finally use a gaussian filter to blur the layer

This leaves a model of the gradient as shown below.

Now set the combine mode of the gradient layer (A) to difference and adjust the opacity so that there is some background level, but no gradient and flatten the layer stack to get the image below.