LRGB combination

Emanuele

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

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.
 
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 :)


EDITED AS OF 11 MAY 2023

Setting the three luminance coefficients to the same value and all chromaticity coordinates to 1/3 leads to a singular matrix, so the above procedure is not feasible as I described it back in 2010. See the related thread where this problem was pointed out.

You can, however, try to perform a YRGB combination as described above in a linear RGB working space with gamma = 1 and equal luminance coefficients, but using the default chromaticity coordinates.
 
Last edited:
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.

 
You have not been eating your greens

:D

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.
 
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
 
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.
 
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.
 
Very intersting thread! ;)

Juan Conejero said:
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
 
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
 
Let me know if you try this method.

As follows - Combined individual Grey R, G, B using ChannelCombination and uniform RGBWorkingSpace. This was followed by STF and BackgroundNeutralisation and ColorCalibration. SCNR Green Average Neutral was applied before recombining the L* component with the RGB, to prevent green rings forming around the brighter stars. A good result.

It didn't seem to matter that on the first try I forgot to redefine the default RGBWorkingSpace for the RGB image.

Plus a bit more HWT, LRGBCombination and CurvesTransformation. This is a much better result.

http://pixinsight.com/forum/index.php?action=dlattach;topic=2497.0;attach=1263





 
Combining the RGB images was linear. My understanding is that after that it is necessary to stretch the L image and the combined RGB to an approximately acceptable amount and extract L*, linear fit with L as the reference and channel combine with the RGB - as per...

- 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.
 
Nice thread!

@astropixel: I can't access the url you pasted! (http://pixinsight.com/forum/index.php?action=dlattach;topic=2497.0;attach=1263)

Cheers,

Jose
 
Try this one - http://pixinsight.com/forum/index.php?topic=2497.msg16833#msg16833

Incidentally, I have scheduled a run for shorter luminance exposures to manage the core brightness more effectively.
 
Back
Top