A helpful tip: Plastic surgery for improved star-free images

13 replies1.4k views
urban.astronomer avatar
I am probably not the first to appreciate the wonders of Starnet and other star-removal tools in astrophotography. However being a great tool for identifying and removing stars, the replacement job is often poor, especially for very bright stars.  The resulting image is left with "scars" where the stars have been removed.

As I have not found any good solutions for improved star replacement, I have made my own plastic surgery procedure using Photoshop. It seems to be working quite ok, so I would like to share it with the community. The procedure is using the AI based content-aware fill and goes like this:

1. Run Starnet and produce both a STAR_FREE image and a STAR_MASK image.
2. Load both the STAR_FREE and the STAR_MASK images into Photoshop.
3. Use the magic wand selction tool and select the black area in the STAR_MASK. Then invert selection (so that the stars become selected), and adjust by either marking similar areas (Select > Similar) or simply expand (Select > Modify > Expand) the selection by 1-3 pixel(s) depending on how well the magic wand was able to select all the stars.
4. Transfer the selection from the STAR_MASK over to the STAR_FREE image. There are several ways of doing this in Photoshop, but I found it safest to save the selection, preferably as a part of the STAR_FREE image, then load the selection in the STAR_FREE image.
5. With the star_selection loaded on top of the STAR_FREE image, run Edit > Fill and select Content-Aware in the Contents menu. Make sure also to check for "Color Adaptation". Click Ok, and you have a much smoother image with much less prominent scars.

Example image below shows left to right: 1. Starnet processed. 2. Content aware filled. 3. Original image.



-Martin
Helpful Respectful Engaging Supportive
Annehouw avatar
Hi Martin,

That is a good procedure.
Have you tried out Starnet V2 already. That works a lot better and cleaner.


Anne
urban.astronomer avatar
Have you tried out Starnet V2 already. That works a lot better and cleaner.

No, I was not aware about a new version. It hasn't shown up as an update to Pixinsight yet, but looking forward to it!

-Martin
Well Written
Annehouw avatar
You will have to install it yourself in PI.

More info here: https://www.astrobin.com/zqcm64/
Dale Penkala avatar
Hi Martin,

That is a good procedure.
Have you tried out Starnet V2 already. That works a lot better and cleaner.


Anne

Are you talking about Starnet ++?
Annehouw avatar
Indeed Starnet++ Version 2
Dale Penkala avatar
Indeed Starnet++ Version 2

Ok just making sure there wasn’t something else that come out I wasn’t aware of 😊
urban.astronomer avatar
Dale Penkala:
Ok just making sure there wasn’t something else that come out I wasn’t aware of 😊

It is just called StarNet, not StarNet++ in Pixinsight, even though it is the same thing. I believe this is what's causing the confusion.
Well Written Concise
Dale Penkala avatar
I do have the latest version in PI so I just wanted to make sure I didn’t miss something is all.

Dale
urban.astronomer avatar
I downloaded and installed the new version of StarNet++ as mentioned by @Annehouw and ran it on the same image as before. It is obviously a great improvement to the original StarNet++, and also better than my proposed "content aware" method in Photoshop, not to mention much easier!

Seen below are as follows:
1. (top left): Original detail from the Wizard Nebula
2. (top right): Original StarNet++
3. (bottom left): Photoshop content aware method
4. (bottom right): StarNet++ version 2
Helpful Engaging
ChrisPeace avatar
I am probably not the first to appreciate the wonders of Starnet and other star-removal tools in astrophotography. However being a great tool for identifying and removing stars, the replacement job is often poor, especially for very bright stars.  The resulting image is left with "scars" where the stars have been removed.

As I have not found any good solutions for improved star replacement, I have made my own plastic surgery procedure using Photoshop. It seems to be working quite ok, so I would like to share it with the community. The procedure is using the AI based content-aware fill and goes like this:

1. Run Starnet and produce both a STAR_FREE image and a STAR_MASK image.
2. Load both the STAR_FREE and the STAR_MASK images into Photoshop.
3. Use the magic wand selction tool and select the black area in the STAR_MASK. Then invert selection (so that the stars become selected), and adjust by either marking similar areas (Select > Similar) or simply expand (Select > Modify > Expand) the selection by 1-3 pixel(s) depending on how well the magic wand was able to select all the stars.
4. Transfer the selection from the STAR_MASK over to the STAR_FREE image. There are several ways of doing this in Photoshop, but I found it safest to save the selection, preferably as a part of the STAR_FREE image, then load the selection in the STAR_FREE image.
5. With the star_selection loaded on top of the STAR_FREE image, run Edit > Fill and select Content-Aware in the Contents menu. Make sure also to check for "Color Adaptation". Click Ok, and you have a much smoother image with much less prominent scars.

Example image below shows left to right: 1. Starnet processed. 2. Content aware filled. 3. Original image.



-Martin

Martin. I read your linked thread on how to remove stars in photoshop. How do I get StarNet vs2 to produce a star and a starless image? I’ve downloaded the new version but it’s not got any options/settings I can find that allow a star only mask to be made. 
Hope you can help.
urban.astronomer avatar
Martin. I read your linked thread on how to remove stars in photoshop. How do I get StarNet vs2 to produce a star and a starless image? I’ve downloaded the new version but it’s not got any options/settings I can find that allow a star only mask to be made. 
Hope you can help.

Chris,

I am using StarNet as a plugin to Pixinsight, and have not been using StarNet in other contexts (i.e. Stand alone version or as a photoshop plugin) so I cannot tell how it works there.

In Pixinsight, both StarNet and Starnet2 have a check box where you can select that the starmask should be retained after star removal of the image. So, the following settings should produce both a star-free image as well as another image containing the stars only.


In case you for other reasons have problems in creating a star-only mask, I guess it should be possible to create a star mask in Photoshop by putting the original image and the star-free image in two separate layers and then blend them using the difference option, which should give you the stars only.

Hope this helps,
Martin
Helpful
ChrisPeace avatar
Thanks Martin for the swift reply. 
The stand alone version does not have those options. Thanks for that info. I have used the ‘difference’ option in PS which works nicely but I just thought I was missing an update on StarNet.

clear skies.
Respectful
Nikita Misiura avatar
Martin,

Thanks for a great tip! I remember trying methods like this to at least easily create some good training data for starnet, but found that content-aware fill fails miserably for more or less dense star fields…