Author Topic: How to colorize monochrome data  (Read 2972 times)

Offline astrovienna

  • PixInsight Addict
  • ***
  • Posts: 123
    • View Profile
    • The Hole in the Trees Skybox
How to colorize monochrome data
« on: 2015 October 19 17:52:51 »
I find that some planetary nebulae only have Ha or OIII, not both.  In those cases, I usually colorize the monochrome narrowband data to red or teal/blue and embed it with RGB stars.  Here's an example:

http://www.pbase.com/skybox/image/161547316

In PixelMath I used the OIII data for all three color channels, using (IIRC) 0.3*OIII, 0.6*OIII, and 1.0*OIII for RGB respectively.  Then in Photoshop I layered in the now-colorized OIII image on top of RGB stars.  Is there a better way to colorize the monochrome data?  And is there a way to do the "layering" in PI?

Kevin

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #1 on: 2015 October 19 23:18:07 »
Kevin,

I've used PixelMath to generate a CIE L*c*h* image from mono data with ChannelCombination.  You can just use the data itself for L.  For the c component you could try just a small fixed value or something based on the original data (so that brighter areas have higher chrominance.)  The more interesting part is building the h component.  You want to map your data values into a small range of hues, e.g. magenta to orange looks good for Ha.  I have thought about writing a script to do this because it can take a fair amount of messing around and trial and error to do manually.

Here's a fairly extreme example of colouring some Ha: http://www.astrobin.com/141108/
This less extreme version uses the same technique to make a bi-colour more interesting: http://www.astrobin.com/full/143114/0/

For adding RGB stars I usually do a CIE L*a*b* channel extraction of the narrowband and RGB images then use a star mask and PixelMath to blend the data from the RGB a* into the NB a* and the RGB b* into the NB b* then recombine the channels and voila!

Cheers,
Rick.

Offline astrovienna

  • PixInsight Addict
  • ***
  • Posts: 123
    • View Profile
    • The Hole in the Trees Skybox
Re: How to colorize monochrome data
« Reply #2 on: 2015 October 20 07:58:54 »
Hi Rick,

Can you give some details on how you do that with PixelMath?  I see the functions, but I haven't a clue how to use them to create an image.

Kevin

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #3 on: 2015 October 21 15:36:22 »
Give me a day or two, Kevin, and I'll post an example.

Cheers,
Rick.

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #4 on: 2015 October 22 02:38:27 »
Example time... colourizing some Ha data of NGC6888.  The Ha is already stretched.

Luminance: just the original Ha image

Chrominance: a copy of the original Ha image clipped and stretched with Histogram transformation.  The clipping is to make a nice black background.  The stretching is to make the bright areas nice and saturated (maybe too much in this quick example!)

Hue: take another copy of the original Ha data and stretch with HistogramTransformation until the peak of the curve is around 0.5. Now we'll reduce the range of the data.  I want to end up with a range of colours from magenta through to orange which is roughly 1/3 of the Hue space, so I'll use the PixelMath expression "$T/3".  Now I want to map this range into values from 0.85 (magenta) to 0.15 (orange) so I use more PixelMath: "iif($T-0.15<0,$T+0.85,$T-0.15)".  This is complicated a bit because the reds wrap around at the value 1.0.

Now it is just a matter of using ChannelCombination in the CIEL*c*h* colour space to combine the Luminance, Chrominance and Hue data.  The result is attached.

I'm assuming that the reader already has an idea of how the Hue component works in PI.  If not, then that's a little research project.  A good way to start understanding it is to take a look at the CurvesTransformation process with a "H" curve selected.  Along the X axis you'll see the Hue values from 0  to 1.0.

Cheers,
Rick.
« Last Edit: 2015 October 22 02:52:24 by RickS »

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #5 on: 2015 October 22 03:38:07 »
Here's some coloured Oiii data (similar process with different PixelMath expression for the Hue: "$T/6.25+0.53"). The second image is a blend of the coloured Ha and Oiii.

Offline astrovienna

  • PixInsight Addict
  • ***
  • Posts: 123
    • View Profile
    • The Hole in the Trees Skybox
Re: How to colorize monochrome data
« Reply #6 on: 2015 October 22 05:31:14 »
Thanks Rick.  That's very helpful.  The key thing I missed before was that you do the actual merge with ChannelCombination, not PixelMath.  Now time for some experimenting.  I have lots of bicolor data to process.

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #7 on: 2015 October 23 03:31:22 »
Final version of the bi-colour image here... http://www.astrobin.com/full/221473/0/

Offline jerryyyyy

  • PixInsight Old Hand
  • ****
  • Posts: 421
    • View Profile
    • Astrobin Images
Re: How to colorize monochrome data
« Reply #8 on: 2015 October 23 06:38:25 »
Thanks very much for the explanation Rick. 
Takahashi 180ED
Astrophysics Mach1
SBIG STT-8300M and Nikon D800
PixInsight Maxim DL 6 CCDComander TheSkyX FocusMax

Offline astrovienna

  • PixInsight Addict
  • ***
  • Posts: 123
    • View Profile
    • The Hole in the Trees Skybox
Re: How to colorize monochrome data
« Reply #9 on: 2018 February 10 06:06:51 »
Sorry for reviving an old thread, but I've been trying to implement this technique on some Ha data (Sh2-217) without much luck.  I've had pretty good luck with OIII data in the past.  The stretched Ha is here:

https://www.dropbox.com/s/ollt599ivl7uvkg/Ha_StretchedFinal.xisf?dl=0

I've noticed that the result tends to be burned out in the brighter areas, and the degree varies depending on what color I aim for.  Using Rick's Ha formula above, I get a nice orange nebula with fairly good detail in the core, but still some bright areas are a bit burned out.  I'd like it to be red, leaning a bit toward magenta, so I used the formula [iif($T-0.23<0,$T+0.77,$T-0.23)] but the result is quite burned out and loses much of the contrast in the brighter areas.  Any idea what I'm doing wrong?

Kevin

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #10 on: 2018 February 11 18:54:19 »
Hi Kevin,

I'll have a play with the data tonight if I get a chance.

Cheers,
Rick.

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1296
    • View Profile
Re: How to colorize monochrome data
« Reply #11 on: 2018 February 26 23:00:25 »
Sorry, have been pretty busy with work and difficult personal stuff (dealing with ageing mother and mother-in-law).  Did you figure this out?  I'm still happy to help but can't guarantee a fast turnaround.

Offline astrovienna

  • PixInsight Addict
  • ***
  • Posts: 123
    • View Profile
    • The Hole in the Trees Skybox
Re: How to colorize monochrome data
« Reply #12 on: 2018 February 27 14:13:35 »
Rick, not to worry!  Aging parents on this side of the ocean as well.

In the end I didn't use the monochrome approach on this, as I was quite pleased with how a bicolor turned out, despite the very low OIII signature. 

http://www.pbase.com/skybox/image/166991512/original

If you get a chance to look at the data that would be helpful for future processing efforts, as I do a lot of planetaries that often turn out to be OIII-only or Ha-only.  But no hurry at all.

Kevin