Go Back   IceInSpace > Equipment > Software and Computers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #1  
Old 05-08-2014, 10:47 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
using PixelMath to get rid of magenta stars in SHO/Hubble palette narrowband

Update: See post #8 below. I've tweaked the formula specifically for magenta now, and updated the zip file with process icon below. Just download the zip file, unzip somewhere safe and memorable (My Documents/PixInsight or something like that). In PixInsight, choose "Load process icons" and browse to that xpsm file you unzipped. The magenta_reduction PixelMath process icon should appear on the PI desktop, and you can just drag and drop that on your image.

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

-----------------------
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)||((mi n($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.
Attached Thumbnails
Click for full-size image (Eta before after.jpg)
134.2 KB134 views
Click for full-size image (NGC7822 before after.jpg)
145.5 KB105 views
Click for full-size image (Bob Frank before after.jpg)
68.0 KB106 views
Attached Files
File Type: zip Magenta_Star_Reduction.zip (890 Bytes, 79 views)

Last edited by troypiggo; 10-08-2014 at 06:23 PM.
Reply With Quote
  #2  
Old 05-08-2014, 11:17 PM
pluto's Avatar
pluto (Hugh)
Astro Noob

pluto is offline
 
Join Date: Dec 2011
Location: Sydney
Posts: 1,982
That's really interesting Troy.
I've tried a similar technique in Lightroom with mixed success.
I've also played with this in Photoshop but I find Lightrooms approach more intuitive.

I think it worked well in this SHO Carina nebula:
http://hughsblog.wordpress.com/2014/...ubble-palette/
But then the couple of images I did after this looked weird and seemed to look better with magenta stars, like this M16:
http://hughsblog.wordpress.com/2014/...ubble-palette/
Reply With Quote
  #3  
Old 06-08-2014, 07:30 AM
RickS's Avatar
RickS (Rick)
PI cult recruiter

RickS is offline
 
Join Date: Apr 2010
Location: Brisbane
Posts: 10,584
Nice technique, Troy.

I've done something similar using the CIE a and b channels to select areas of magenta (and other colours). I find the results are a bit more consistent using a/b rather than RGB values because you're working purely with the colour component.

Of course, the easy way to desaturate magenta halos in PI is with the ColorSaturation process...

Cheers,
Rick.
Reply With Quote
  #4  
Old 06-08-2014, 09:05 AM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Thanks guys.

Rick - I'd be interested to see your CIE a and b solution. I'm not as familiar with that colour space.

The reason I like this solution is that there's no star masking needed, so you can't get dark halos. It just detects magenta (defined by a red to blue ratio of 0.9 say) as well as the mean of red and blue being greater than the green. There could be some colour shifts in nebulosity as well as stars in rare instances where this rule is matched, but with SHO palette the green would be close to the mean of red/blue so increasing the green a little is not that noticeable in the test images I tried.
Reply With Quote
  #5  
Old 06-08-2014, 09:20 AM
RickS's Avatar
RickS (Rick)
PI cult recruiter

RickS is offline
 
Join Date: Apr 2010
Location: Brisbane
Posts: 10,584
Quote:
Originally Posted by troypiggo View Post
Rick - I'd be interested to see your CIE a and b solution. I'm not as familiar with that colour space.
I'll post an example tonight. I usually build them on the fly.
Reply With Quote
  #6  
Old 07-08-2014, 06:39 PM
RickS's Avatar
RickS (Rick)
PI cult recruiter

RickS is offline
 
Join Date: Apr 2010
Location: Brisbane
Posts: 10,584
Troy,

I tried your process icon on my M17 data and it did a good job on the stars but had trouble with the bright nebulosity (maybe I should have killed the CIEL() subexpr). See attached before and after images. Still a very cool demonstration of the power of PixelMath!

Here's a quick & dirty expression that creates a magenta mask that works for my M17: "CIEa($T)>0.62&&CIEb($T)<0.59".

Mostly I use the ColorSaturation process to kill my magenta fringes. Another great tool is ColorRange from Carlos Milovic. It allows you to define a range of colours in a selectable colour space (RGB, CIELAB, etc.) and then builds a mask that selects those colours in an image.

Cheers,
Rick.
Attached Thumbnails
Click for full-size image (Before.jpg)
156.4 KB75 views
Click for full-size image (After.jpg)
167.1 KB87 views
Reply With Quote
  #7  
Old 07-08-2014, 09:31 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Cheers mate. I'll have a play tomorrow. Think you're right about the CIEL not being needed. I had another idea tonight to improve that I want to try too.

Haven't seen that colour selection tool. Will look into that too.
Reply With Quote
  #8  
Old 09-08-2014, 10:53 AM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
Ok. Greatly simplified the formulae, and it targets the magenta specifically which is great. Will work best on images before you do any colour shifting to get the teals and golds, as it relies on the relationship between R and B. It simply boosts the G value to the minimum of R and B.

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

Images below show it's effect on a colour wheel. Note the previous versions of the formula affected much more of the colour wheel.
Attached Thumbnails
Click for full-size image (Clipboard01.jpg)
138.7 KB70 views
Click for full-size image (Clipboard02.jpg)
137.5 KB56 views
Click for full-size image (Clipboard03.jpg)
127.9 KB52 views
Reply With Quote
  #9  
Old 09-08-2014, 09:05 PM
RickS's Avatar
RickS (Rick)
PI cult recruiter

RickS is offline
 
Join Date: Apr 2010
Location: Brisbane
Posts: 10,584
Not bad, Troy. See before and after examples...
Attached Thumbnails
Click for full-size image (Before.jpg)
39.2 KB91 views
Click for full-size image (After.jpg)
41.1 KB106 views
Reply With Quote
  #10  
Old 09-08-2014, 09:23 PM
troypiggo's Avatar
troypiggo (Troy)
Bust Duster

troypiggo is offline
 
Join Date: Nov 2008
Location: Brisbane, Australia
Posts: 4,846
That looks like the result I had in mind
Reply With Quote
  #11  
Old 09-08-2014, 09:55 PM
RobF's Avatar
RobF (Rob)
Mostly harmless...

RobF is offline
 
Join Date: Jul 2008
Location: Brisbane, Australia
Posts: 5,735
Impressive stuff Troy. Way beyond my feeble understandings of PM. Thanks for the insights guys.
Reply With Quote
  #12  
Old 10-08-2014, 08:15 AM
peter_4059's Avatar
peter_4059 (Peter)
Big Scopes are Cool

peter_4059 is offline
 
Join Date: Jun 2007
Location: SE Tasmania
Posts: 4,574
Looks good Troy.
Reply With Quote
  #13  
Old 10-08-2014, 12:44 PM
ozstronomer's Avatar
ozstronomer (Geoff)
Registered User

ozstronomer is offline
 
Join Date: Jul 2007
Location: Brisbane
Posts: 965
Troy

Nice work with Pixmath, I ran it over a wide field of The Craw taken through the Megrez 72mm doublet which showed some violet fringing and it made a difference to the overall star colour, stars now appear whiter.


Many thanks

Geoff
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 11:21 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement