How do you remove halos?

10 replies344 views
Stuart Taylor avatar
Can I ask how you guys remove halos? I use an Optolong L Extreme filter (with an OSC) for imaging nebulae and I really like the results apart from the serious halos around bright stars. Towards the end of my workflow I use Star XTerminator but although it removes the stars really well, it doesn't remove the halos (which remain as bright circular artifacts on the starless image).

I know many of you also use this filter (or filters with similar halos) so it would be great to hear how you handle them.
Well Written Respectful Engaging
Stefan Pfleger avatar
If you have a clean color channel, you can use that to subtract out the halo. This may or may not work well depending on the halo ajd where it is. 
What do i mean by subtract? I mean it quite literally like flats XD.

1. Halo Channel - Clean Channel + med(Clean Channel) = Halo mask
2. You may need to mask out the areas of the image unaffected by halos or smooth the halo mask really strong, so that no data is altered at the clean areas.
3. Subtract the halo out: Halo Channel - Halo mask + med(Halo mask)

Alternatively the good old clone stamp on star less images might work even better, but the first option I show aims to preserve the original details behind the halo. It has worked for me before.

Alternatively you can also linear fit a clean channel to the halo channel and replace the halo by the clean channel with help of a mask. (E.g. GAME script in Pixinsight).

All of these methods should also be doable without pixinsight i think, but PI makes it easier

Also check out following: https://youtu.be/cSKyLbfiolQ

I hope this helps,
Greetings, Stefan.
Helpful
Stuart Taylor avatar
Stefan Pfleger:
If you have a clean color channel, you can use that to subtract out the halo. This may or may not work well depending on the halo ajd where it is. 
What do i mean by subtract? I mean it quite literally like flats XD.

1. Halo Channel - Clean Channel + med(Clean Channel) = Halo mask
2. You may need to mask out the areas of the image unaffected by halos or smooth the halo mask really strong, so that no data is altered at the clean areas.
3. Subtract the halo out: Halo Channel - Halo mask + med(Halo mask)

Alternatively the good old clone stamp on star less images might work even better, but the first option I show aims to preserve the original details behind the halo. It has worked for me before.

Alternatively you can also linear fit a clean channel to the halo channel and replace the halo by the clean channel with help of a mask. (E.g. GAME script in Pixinsight).

All of these methods should also be doable without pixinsight i think, but PI makes it easier

Also check out following: https://youtu.be/cSKyLbfiolQ

I hope this helps,
Greetings, Stefan.

Thanks for replying Stefan. Can I just check what you mean by "clean color channel"? Do you mean an R, G or B channel of the starless image which doesn't contain the halo? (I must admit, I haven't inspected the R,G and B channels). Also, in 1. what do you mean by "med"?

I use Pixinsight by the way, so presume you are referring to pixelmath expressions here?
Well Written Respectful Engaging
Stefan Pfleger avatar
Clean channel is just any color channel without the halo sometimes the halos only happen in a specific color or in case of mono with a specific filter.

In my case, the Lum was clean and i used it to remove a halo in green and blue channels.

med is the median of the Image, just chuck the formula as is into pixelmath. Should work, sort of i think.
Stuart Taylor avatar
Stefan Pfleger:
Clean channel is just any color channel without the halo sometimes the halos only happen in a specific color or in case of mono with a specific filter.

In my case, the Lum was clean and i used it to remove a halo in green and blue channels.

med is the median of the Image, just chuck the formula as is into pixelmath. Should work, sort of i think.

Great! Thanks. I'll try this 
Tom Boyd avatar
For what it's worth, below is my workflow for creating and then using halo reduction masks using the Game script in PixInsight.

Dale Penkala avatar
Hello Stuart,
I use a technique by Charles Bracken to help control halo’s. You use a clone of the image with the halos and then create a mask using a very simple pixel math expression. Charles explains it here: https://digitalstars.wordpress.com/2019/10/27/tutorial-how-to-eliminate-star-halos-in-pixinsight/
I find that moving the middle point slider works better for me but give it a try. I think as you use this you will find other things you can use it on.

Dale
Helpful
jewzaam avatar
I have been exporting the starless luminance (which could be extracted from RGB) into Affinity Photo and using inpaint to remove strong halos.
Rob Foster avatar
Hi Stuart, 
I've managed in either linear or non-linear phase with similar workflow. I am using a DSLR/OSC camera, but believe it would work with mono/color channels seperately.

I use StarXTerminator, then work on the halos in the Starless image where the halos are more prominent. 

In PI, I use the Game Script to create an ellipse/circle with borders that go well beyond the border of the halo and create a gradient mask and apply that to the starless image so I am just working on the halos.  Then use MLT (if in linear)  or MMT (if non-linear) with @ 10- 12 layers, and deselect most of the layers except the Residual layer and perhaps the largest couple of layers.  I then apply this to attenuate/knock down the halo, sometimes having to apply more than once.  Depending on degree of Saturation, I'll sometimes desaturate a bit as well.  Once the halo more or less disappears/becomes less obvious/blends into the background, you can do a quick PixelMath combination with the Stars only image to see if you are on the right path.  

If it looks unnaturally smooth and you can see that in the combined image, then you can go back to the starless image and with that same mask in place, use the Noise generator to match the surrounding background noise.  

I'll often "tweak the mask" on the fly, most commonly increasing the size (Morphological Transformation Dilation with 25 as the largest option) and/or adding in convolution.  

Good luck!
Rob
Helpful
Stuart Taylor avatar
many thanks everyone. Plenty of ideas to try out here! I had never heard of the game script, so i shall go and track that down (as I don't recall seeing it in the standard distribution of PI).
Dale Penkala avatar
Stuart Taylor:
many thanks everyone. Plenty of ideas to try out here! I had never heard of the game script, so i shall go and track that down (as I don't recall seeing it in the standard distribution of PI).

Here you go for the download Stuart: http://www.skypixels.at/pixinsight_scripts.html#game