Coping with light pollution using artificial flat field subtraction
This is a simple and probably very old trick but it is quite useful to know.
This is the original picture, not many stars are visible and the colour is bad. Vignetting makes the corners are darker because of limitations of the lens used.
This is what we get if we try to adjust the brightness and contrast, since the light pollution and vignetting is uneven it is hopeless to get a good result.
What we need to do is to subtract the sky and the vignetting before we adjust the contrast and brightness. We create an artificial flat field by replacing every pixel in the image with the median of the pixels around it to remove the stars.
Then we subtract the artificial flat field from the original and adjust the brightness and contrast. Now we get many more more visible stars and useful colours.