Author Topic: using PixelMath to get rid of magenta stars in SHO/Hubble palette narrowband  (Read 29190 times)

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Update to the below:

There are some images and colour combinations that did show odd results.  Check out my post further down this thread.

Now I'm using the following formulae, just boosting G to the min of R and B.  See the link above for effects on a colour wheel showing how it much better targets just the magenta.

R: $T[0]
G: iif(min($T[0],$T[2])>$T[1],min($T[0],$T[2]),$T[1])
B: $T[2]

The attached zip file has been updated to use this formula.

---------------------------------------------

Original post:

Not sure if this has been done before, but I had this idea recently on how to get rid of the magenta stars in SHO narrowband images due to the red SII and blue OIII channels needing to be stretched so much to balance strong G Ha.  A common Photoshop method I've seen is to do a selection based on colour (magenta), and desaturate it.

It occurred to me that with PixelMath we may be able to achieve something like this.  We could detect if a pixel is magenta by checking if it's R and B channels were of similar value (within some acceptable range), and if they both were significantly brighter than the G channel.

With this in mind, I came up with the following formulae.  I found some stars needed a luminance  rule in there too.

R: $T[0]
G: iif((CIEL($T)>MIN_BRIGHTNESS)||((min($T[0],$T[2])/(max($T[0],$T[2])>MAGENTA_DEFN))&&(mean($T[0],$T[2])>$T[1])),mean($T[0],$T[2]),$T[1])
B: $T[2]
Symbols: MAGENTA_DEFN = 0.9, MIN_BRIGHTNESS = 0.9

Attached are some sample before and after images (not my images, but have sought the approval of the image owners where possible.  Some were from a Google image search).  Seems to work ok to me.  Thoughts?  Any improvements or suggestions on the above?

I'm just hoping it is a quick and simple solution to what seems to be a common issue with narrowband images.  Just drag and drop the attached process icon on your final narrowband image with magenta stars and they're gone.
« Last Edit: 2014 August 08 18:01:55 by troypiggo »

Offline NGC7789

  • PixInsight Old Hand
  • ****
  • Posts: 391
I am just beginning to collect narrowband data and I will add this to my list of threads. Nice work.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Troy,

Nicely done!  Will try this out on some of my old NB images at let you know how it works.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Troy!
Very nice idea and PixelMath Expression!

Gerald

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
really nice work! i think this was the last piece of the puzzle for my for PI NB processing.

rob

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Replacing G with Mean(R, B) will boost the pixel's luminance. This maybe OK or not. If not, all components could be scaled down. The scale factor would be something like the CIEL luminance ratio cubed (or cube-rooted?) so to appropriately linearize the ratio.

Mike

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Mike,

For us who are NOT pixelmath experts, could you go into a little more detail on how you would apply your proposed fix?

Thanks!

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Troy,

I hope you don't mind but I am going to include this in the next version of my cribsheet.  This is too good to pass up.

Thanks again!

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Troy,

Good PixelMath-Fu! :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Replacing G with Mean(R, B) will boost the pixel's luminance. This maybe OK or not. If not, all components could be scaled down. The scale factor would be something like the CIEL luminance ratio cubed (or cube-rooted?) so to appropriately linearize the ratio.

True.  I've been experimenting with that to try to keep the input and output luminances the same, but nothing got the consistent results that the above formula did.  I'll keep trying to come up with something.

Don't suppose you know the relationship between the individual channel values and the lum?  It's not additive as I'd expect.

For us who are NOT pixelmath experts, could you go into a little more detail on how you would apply your proposed fix?

I'll go back and edit the first post with more explanation when I get a chance.

Troy,

I hope you don't mind but I am going to include this in the next version of my cribsheet.  This is too good to pass up.

Thanks again!

No worries at all.

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
For us who are NOT pixelmath experts, could you go into a little more detail on how you would apply your proposed fix?
Jim

Jim,
Actually my suggestion probably won't work. Preserving luminance, as I was thinking, might not make sense, since input luminance itself might be too high due to the RB bloat. Not sure what to do.
Mike


Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Mike,

Thanks anyway.  As an old liberal arts major (and I do mean old), you guys who can do the math fascinate me.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline Warhen

  • PTeam Member
  • PixInsight Old Hand
  • ****
  • Posts: 490
    • Billions and Billions
Troy, et al., Cool! It might also be useful to expand SCNR's capabilities to include Magenta and Cyan. Most cases, we'd still want to use a star mask, but we'd be able to target magenta stars that way. Of course, we do have both ColorSaturation and Curves/Saturation enabling us to reduce or alter a specific range as well.
Best always, Warren

Warren A. Keller
www.ip4ap.com

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
G'day Warren. Not sure what you mean about SCNR?

What I liked about the PixelMath solution is that no star masks are needed at all, so no risk of halos. You just drag n drop the process icon on you full, unmasked image.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
OK, stupid question time,

I am trying to access the process Troy provided in the zip folder but don't know where to put it to get it working  :-[

Can somebody just remind me where to access the unzipped file from.

Sorry for the early onset dementia,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse