I’ve been struggling for some time now to find a decent method to fix the brightest stars in my images. Since some stars are so much brighter than the deep space objects I am imaging, they become saturated due to the limited well depth of cameras. This means that information is inevitably lost. Once you get to color calibrating, especially with a OSC camera, you are typically left with magenta cores in the brightest stars from the green channel being scaled back. If not dealt with well enough, these stars can become eyesores when you reach color saturation and star reduction techniques.
There seem to be a couple of ways to deal with this. The first, and easiest, is to simply set the white point of the image to a value that clips all of these magenta pixels to white in all three channels. While this can work if you like to go for a hard MTF that basically saturates your stars anyways, I’ve been trying to retain some semblance of star color. This can leave very harsh edges on the star cores that look rather odd when the stars are de-emphasized, or you may retain hints of false color from poor clipping. And it’s terrible to have to go all the way back to fix the stars when you finish your image and start pixel peeping.
Another method is the Repaired HSV separation script. This script has been very hit and miss for me. Some of my stars have a strange split color to them that I have not mechanically fixed yet. This can make the stars have very strange colors in the cores. With its strict thresholding, it becomes very tedious to determine the parameters that give decent correction without artifacts.
I wanted something that doesn’t require strict thresholding, and that can be finely adjusted and relatively easily tested. I’ve found the following method to work well with a first test image,
- Extract the HSV channels from the image.
- Clone the V channel.
- Set this V channel clone as a mask for the H and Sv channels.
- Apply a histogram transformation to the V mask. You want to white clip pixels that are magenta in the original image and up the black point to exclude anything but the affected bright stars.
- Run a large convolution on the H and Sv images, possibly several times.
- Recombine the H, Sv, and original V images.
Let’s run through an example. Here is an orange star that shows a magenta core from sampling saturation and color calibration,
We will extract the HSV channels, and clone the V channel.
You can see in the H and SV channels how drastically different the color of the core is from the halo of the star. We will now replace the core with a combination of the colors of the halo. The bottom V image will be our mask. We will white clip it a bit so that the problem pixels are completely modified, and try to achieve a smooth transition along the profile of the star while also excluding the background,
The clipping points were chosen by examining the pixels of the star. If we don’t like the choice, we can quickly undo the transformation and adjust it. Set this image as the mask of the H and Sv images. Next, open the Convolution module. Depending on your star halo sizes, you will want to play around with this for a bit. For me, the halos of the saturated stars are quite large, so I used a large kernel with a very wide shape,
Apply this convolution to the H and Sv images. We want the star cores to look more like the halo around them in each image,
That looks a bit better! We could even run the convolution again to smooth it out even more. To test, we can recombine the channels together into RGB.
A significant improvement!
If the mask does not seem to extend as much as you need, you could apply a dilation filter to expand the V mask,