Author Topic: ColorClip script for repair of blown-out star cores  (Read 167 times)

Offline TinySpeck

  • Newcomer
  • Posts: 39
    • View Profile
ColorClip script for repair of blown-out star cores
« on: 2019 February 20 09:14:50 »
I do my astrophotography with a 14-bit DSLR, and find that I usually have several bright stars with blown-out "magenta" cores in my images.  The magenta comes from out-of-range values being created in the debayering process, way early on during stacking.  With a 14-bit camera all my raw pixels should be 0.25 or less in the normalized PixInsight data range, but in my blown-out cores I see values much higher.

The Repaired HSV Separation script doesn't work well for me.  It helps, but star cores are still blown out.  It also puts a break in the image history since it creates a new repaired image.

ColorClip replaces out-of-range pixels with the mean of neighboring in-range pixels.  This can be done early in the linear phase, so dynamic range during stretching is maximized.  It does a decent job of replacing blown-out cores with the color immediately outside the blown-out region and results in more natural-looking stars.  The threshold is adjustable, with 0.25 the default (for 14-bit cameras).

I hope people find this useful.  You can get the script at https://github.com/CarpeCimex/ColorClip .  Please let me know if you find bugs or problems.  It's my first Java script so I'm sure there are some beginner gaffes in there.
Gerrit

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 210
    • View Profile
    • Faint Light Photography
Re: ColorClip script for repair of blown-out star cores
« Reply #1 on: 2019 February 20 09:52:51 »
Gerrit,

It works for me. I tried it on a fully processed image from a grayscale camera (RGBHS). It added color to the biggest brightest stars (and to some quite small, but, presumably, bright stars). The effect was to dull the stars a bit, but I think that can be remediated without much difficulty.

Thanks for a nice addition to the tool set.

Alex

BTW, I often use Repair HSV Separation to good effect, but this is faster and does the job well.

Offline TinySpeck

  • Newcomer
  • Posts: 39
    • View Profile
Re: ColorClip script for repair of blown-out star cores
« Reply #2 on: 2019 February 20 10:08:06 »
Great feedback, Alex, thanks!
Gerrit