Author Topic: LRGB combination  (Read 17700 times)

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
    • View Profile
LRGB combination
« on: 2010 October 25 13:04:13 »
Hi all.

I have no data to play with and so I am studying Pixinsight to try to understand everything I can.
Suppose you have some LRGB frames of an object.
Do you process the L and RGB separately and then blend the two files together, or do you combine the L and RGB while they are still linear, and process it that way?

Thanks.
E.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6694
    • View Profile
    • http://pixinsight.com/
Re: LRGB combination
« Reply #1 on: 2010 October 26 01:30:38 »
Hi Emanuele,

Quote
Do you process the L and RGB separately and then blend the two files together, or do you combine the L and RGB while they are still linear, and process it that way?

You cannot perform a LRGB combination with linear images. The reason is that CIE L*a*b* and CIE L*c*h*, which are used to perform the LRGB combination, are nonlinear color spaces.

So you must process your RGB and L images separately. Apply all required processes to the linear images before LRGBCombination (for example, color calibration and deconvolution should be applied to the linear RGB and L images). Then apply the initial nonlinear histogram transformations to both RGB and L, perform the LRGB combination, and continue working on the combined image. Most PixInsight tools allow you to apply processes only to the luminance of a color image (actually, to the lightness component of CIE L*a*b*), without requiring a separate L image.

In the initial stretch with HistogramTransformation, achieving a good adaptation between RGB and L is very important, and also the most difficult part. The "intrinsic" L in your RGB image will basically be replaced with the L image. You should stretch L first, then stretch RGB to achieve similar levels in its luminance (watch the L display channel, or select the RGB+L pixel readout mode and compare readouts, or extract L from the stretched RGB and compare statistics). The LRGBCombination tool also has a luminance midtones transfer function to fine tune the adaptation. The goal is to achieve an optimal adaptation between luminance and chrominance. Too much luminance means more chrominance noise to achieve the required color saturation. Too much chrominance means more noise in the luminance.

Hope this helps.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6694
    • View Profile
    • http://pixinsight.com/
Re: LRGB combination
« Reply #2 on: 2010 October 26 01:52:33 »
On a side note, combining linear L and RGB is possible in PixInsight. However you must perform a YRGB combination instead of LRGB.

In this case, instead of the CIE L*a*b* space, the CIE XYZ space must be used. CIE XYZ is a linear color space; however, the underlying RGB working space must also be linear in order to preserve linearity in the combined image. The basic procedure would be as follows:

- Define a linear RGB working space. With the RGBWorkingSpace tool, set gamma = 1.0 (disable sRGB gamma function). In addition, I would define a uniform RGB working space in the same operation. So the steps with RGBWorkingSpace are:

* Set the three luminance coefficients = 1.
* Define a uniform energy illuminant by setting the six chromaticity coordinates = 0.333333.
* Disable the sRGB gamma function and set gamma = 1.
* Apply to both the RGB and L images.

- Use the ChannelCombination tool to perform a YRGB combination. Select the CIE XYZ space, disable the X and Z components, and select the L image for the Y slot. Apply to the RGB image and you're done.

- To process the linear luminance of the combined YRGB image, you must select "Linear luminance" in the applied tools, when applicable (for example, Deconvolution and ATrousWaveletTransform allow you to select it).

- After the initial nonlinear stretch with HistogramTransformation, you may want to apply the default RGBWorkingSpace parameters, as a linear uniform space no longer will describe the image appropriately.

This should work :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
    • View Profile
Re: LRGB combination
« Reply #3 on: 2010 October 26 02:24:27 »
wow.... Juan....I have been doing it wrong all along for all my - 2 - images that I have captured since starting to use PI!

After creating the Master L and Master R, Master G and Master B, I basically was combining LRGB using the LRGBCombination process using the default values and weights, and then processing the resulting combination.
I was doing it this way because before using PI I was using Maxim to combine the channels and that's how it's done there. I didn't know I had to do all this for PI!

Question: Suppose I use the first method you outlined (process RGB and L separately). To then combine L to the RGB, which process is better to use:
1. LRGBCombination - deselecting R, G, B channels and leaving all the other parameters as default and apply the L to the RGB image?
2.ChannelCombination - selecting CIE L*a*b* Color space and deselecting the a and b chanell and apply the L to the RGB image?

 No wonder why it has been hard for me to color balance my pictures!

Thank you Juan, very much!
E.

« Last Edit: 2010 October 26 02:30:08 by Emanuele »

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1455
    • View Profile
    • http://www.harrysastroshed.com
Re: LRGB combination
« Reply #4 on: 2010 October 26 02:28:12 »
Hi

You have not been eating your greens  >:D  http://www.harrysastroshed.com/lrgb.HTML


Harry
Harry Page

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
    • View Profile
Re: LRGB combination
« Reply #5 on: 2010 October 26 02:30:55 »
I haven't Harry, you are right. I am guilty of that.  :sealed:

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6694
    • View Profile
    • http://pixinsight.com/
Re: LRGB combination
« Reply #6 on: 2010 October 26 03:41:08 »
Quote
You have not been eating your greens

 :D

Quote
1. LRGBCombination - deselecting R, G, B channels and leaving all the other parameters as default and apply the L to the RGB image?
2.ChannelCombination - selecting CIE L*a*b* Color space and deselecting the a and b chanell and apply the L to the RGB image

Both tools will yield a LRGB combined image. However the LRGBCombination tool provides some goodies that are quite useful and interesting, such as a chrominance-specific noise reduction, and saturation and luminance transfer functions that will help you in adapting L to RGB and achieving the desired color saturation and contrast in the result. So unless you have a strong reason to perform a straight substitution of the L* component, I'd use LRGBCombination.

A nice thing about LRGBCombination (also about ChannelCombination) is that you can use it on previews. You can define some areas of interest with previews and try out different parameters until you're happy.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
    • View Profile
Re: LRGB combination
« Reply #7 on: 2010 October 26 04:56:28 »
Perfect!

I really appreciate your help Juan!  :) Thank you!

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 864
    • View Profile
Re: LRGB combination
« Reply #8 on: 2010 October 26 07:34:27 »
Ok,

You and I should work on article for Sky and Telescope on LRGB.  ;)

But seriously PI gives some real nice advantages to LRGB combination verses PS CS.

There is a lot to be learned on how to approach this process properly.

I bet far too often people do a poor job matching fluxes and therefore noise levels.
Everyone is convinced this process saves them a lot of imaging time too.
It is rather tricky way to go; most don't understand the trade offs.
If you don't do it right the composite images suffers.

Imagers can easily think they need more RGB.
Then you end up taking more RGB on another night.
Net acquistion time may be higher.


Max

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 984
    • View Profile
    • http://www.astrofoto.es/
Re: LRGB combination
« Reply #9 on: 2010 October 26 07:48:59 »
Hi all,

a quick advice before attempting any LRGB combination: Adjust the histogram of the RGB and lum images with the STF. Why? Because the histogram adjustment of STF is based exclusively on statistical properties of the images. This means that, after this histogram adjustment, both images will be more compatible.

I always do this things manually, but I am a manual freak guy.  O0 I. e., I enjoy making always my star masks through ATWT, and I always adjust those masks through MF and curves/histograms. The same happens with LRGB combination. It's hard, but at large term it rewards you with a better eye.  ;) A good astrophoto starts at the eye.


Regards,
Vicent.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6694
    • View Profile
    • http://pixinsight.com/
Re: LRGB combination
« Reply #10 on: 2010 October 26 08:07:04 »
Quote
I bet far too often people do a poor job matching fluxes and therefore noise levels.

And you win the bet :)

We have a nice way to match the fluxes between RGB and L: the new LinearFit tool. This is the basic procedure:

- Apply the initial nonlinear histogram transformations to RGB and L, as we have described above. Adjust the L image first, to the desired brightness and contrast. Then try to match the overall illumination of L when you transform RGB. Do it roughly by eye using the CIE L* display mode (Shift+Ctrl+L, Shift+Cmd+L on the Mac). Don't try to do a particularly accurate work here; we'll do much better in the next steps.

- Extract the CIE L* component of RGB with the ChannelExtraction tool (select the CIE L*a*b* space, uncheck a* and b*, and apply to RGB).

- Open the LinearFit tool (ColorCalibration category) and select the L image as the reference image. Apply to the L* component of RGB that you have extracted in the previous step.

- Reinsert the fitted L* in the RGB image with the ChannelCombination tool.

Now your RGB and L images have been matched very accurately. Use the LRGBCombination tool with them. You shouldn't change the luminance transfer function, neither the channel weights, as LinearFit has already done the matching job much better than anything you could do manually.

Let me know if you try this method.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
    • View Profile
Re: LRGB combination
« Reply #11 on: 2010 October 26 08:18:20 »
Great thread, thanks Juan and Vicent for the detailed and very helpful information.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline Jordi Gallego

  • PixInsight Addict
  • ***
  • Posts: 279
    • View Profile
Re: LRGB combination
« Reply #12 on: 2010 October 26 11:07:34 »
Very intersting thread! ;)

Let me know if you try this method.

I will also try it Juan. Usually I perfom a manual balance of the luminance and the luminance of RGB with the Luminance transfer function of LRGBCombination tool, but this system seems quite more acurated ;)

Regards
Jordi
Jordi Gallego
www.astrophoto.es

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1455
    • View Profile
    • http://www.harrysastroshed.com
Re: LRGB combination
« Reply #13 on: 2010 October 26 11:42:22 »
Hi

Some great info there for me to try  ;D   Most excellent


Harry
Harry Page

Offline papaf

  • PixInsight Addict
  • ***
  • Posts: 182
    • View Profile
Re: LRGB combination
« Reply #14 on: 2010 October 30 01:12:23 »
Just ridiculous how big an improvement was this post to my images!
First of all, I had no idea I could (and should, really) have used DBE on my lum images. I thought the image needed to be color. That made a huge improvement in boosting dark areas.
Second, Juan's rgb light adjustment via LinearFit tool is awesome. Color comes just right after the LRGB combination. No need to fiddle with colors balance anymore! I just touched saturation a bit with masked curves, but that's more taste than anything else, I think.

Nice stuff boys! Keep it up!!  8)

Fabio