ColorClip script for repair of blown-out star cores

TinySpeck

Well-known member
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,

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.
 
Thanks for the report @niccoc1603.  I just downloaded 1.8.7 myself last night, and will look into this tonight.
 
It works fine on 1.8.7 for me.  This was after installing the update from 20191002-windows-x64-core-c.zip, but that was a single bug fix and shouldn't have made a difference.

Can you describe what problem you're seeing?
 
I copied the js file in script folder, then go to Script-Feature Script-Add and point to the folder, but after the scan there is no new filters showing up
 
When I did that it looked like nothing happened, but ColorClip showed up in the Scripts / Utilities menu.  You may need to restart PixInsight to see this.
 
just installed my previous set of scripts, including ColorClip w/o any trouble, and w/o need to restart PI. (Windows 10)
 
Back
Top