pixinsight吧 关注:34贴子:56
  • 1回复贴,共1

recombining stars with starless images

只看楼主收藏回复

“Unscreening” and re-screening:recombining stars with starless images
-by Russel Croman(BlurXTerminator, StarXTerminator, NoiseXTerminator作者)
Jun 1, 2022
Here is a new (and simple) method to extract and recombine stars with starless images that retains star color and brightness. If you've played around much with removing stars, processing the starless image separately, and then trying to recombine the stars with it, you may have run into difficulties that this method can solve.
First, an original image. This is a section of M20, chosen because it has bright and dim nebula areas, and yellow/orange and blue stars in both regions:

Removing the stars with whatever your favorite tool is, we get:

If we create an image of just the stars by the usual method of subtracting the two images above, we get:

The stars on the right are heavily mis-colored because we subtracted the nebula color that was “behind” them. They are also “weak” – they do not progress to full brightness in their cores – since they had moderately bright pixel values subtracted from them. This is fine if all we want to do is add the stars back to the starless image – this is just reversing the subtraction and works fine. But if we alter the starless image and then do this, we often run into trouble.
For the sake of discussion, let’s assume that we want to add these stars back into the starless image, but with them horizontally flipped. This is of course quite perverse in an astronomical sense, but it illustrates the point. We get this:

The stars on the left are the wrong color, and additionally they are weak and transparent. The stars on the right are also the wrong color, and moreover they are heavily clipped in their cores. We could try to fix the clipping by rescaling the star image, but then the stars on the left would get even weaker.
Now for the proposed approach of “unscreening” and re-screening. We get the unscreened stars using the following expression in PixelMath:
~((~original)/(~starless))
This is just an algebraic rearrangement of the well-known screen blending function. It is mathematically ill-conditioned in that it involves a division with a divisor that can approach or equal zero, but PixelMath handles this nicely:

The star colors are now correct, or at least much more so, and they also have full brightness in their cores. Now if we re-screen a flipped version of these stars onto the starless image, we get this:

Blue stars remain blue, and yellow stars remain yellow. It’s not perfect in that the halos around the stars on the left are truncated since they came from a bright area, but this is an extreme example… we wouldn’t usually add stars back in with their positions completely changed like this.
A comment on the bright blue star on the right: its halo has taken on a magenta color. But this is correct! A blue star in front of a red nebula will have magenta chrominance in the halo since we are detecting light from both the halo and the nebula in these pixels. This is in fact what the screen blending mode was originally developed to achieve: an approximation of the mixing of light.
Here is another example: let’s say we want to combine RGB stars with a narrowband nebula image. Here are M20’s stars from above combined with a starless image of a portion of NGC6188 using the add-subtracted-stars method. This is again astronomically perverse, but illustrative. I chose the positioning of the stars strategically to show the issues:

The bright blue and yellow stars in the upper right are very clipped, and the stars on the left are again weak and have the wrong color.
Here is the same using the screen-unscreened-stars method:

Again we see that star color and brightness are retained.
A perhaps more common example is to simply de-emphasize the stars using a gamma adjustment to the star image. If we do this using the subtracted stars and then add them back into the starless image, we get this:

The stars have become weak and transparent, and their colors have shifted due to the nebulosity behind them.
Here is the result of doing the same gamma adjustment on the unscreened stars, then re-screening onto the starless image:

Hope this is useful... it's saved me a lot of time in processing.
That expression is the one to use to generate the stars-only image from the original and starless images.
To re-screen the stars back onto the (perhaps further processed) starless image, it is:
~((~starless)*(~stars))
or, since op_screen() has been added to PixelMath:
combine(starless, stars, op_screen())


IP属地:吉林1楼2023-07-24 15:52回复
    Russel Croman=>Russell Croman 作者名更正一下:-)


    IP属地:吉林2楼2023-07-24 16:06
    回复