Author Topic: PixInsight LRGBCombination Creating Red Smuge  (Read 1877 times)

Offline akulapanam

  • Member
  • *
  • Posts: 60
    • View Profile
PixInsight LRGBCombination Creating Red Smuge
« on: 2016 January 31 00:40:06 »
I'm getting a bizarre area of red noise when using the LRGBCombination tool vs. using CCDStack or Nebulosity to create the LRGB.  My general process has been as follows:

Use PixelMath or ChannelCombination to create RGB image
Apply DBE (sometimes even reapplying DBE)
Apply BackgroundNeutralization
Apply Color Correction
Use SFT to stretch

Use DBE on L
Use SFT to stretch L

Use LRGBCombination to apply L on to the stretched RGB image.  I have tried every possible approach including applying DBE to each channel individually.  Before the L application the RGB stretch looks flat and using display shows the R, G, and B individually looking fine.

Now if I use CCDStack or Nebulosity 4 to create the LRGB image and then process it as if it is combined I get a very different result...

Any ideas why?

Offline akulapanam

  • Member
  • *
  • Posts: 60
    • View Profile
Re: PixInsight LRGBCombination Creating Red Smuge
« Reply #1 on: 2016 January 31 00:43:19 »
CCDStack/Nebulosity version - The problem here is the odd reddish rings on stars

Offline akulapanam

  • Member
  • *
  • Posts: 60
    • View Profile
Re: PixInsight LRGBCombination Creating Red Smuge
« Reply #2 on: 2016 January 31 21:15:15 »
Ok I was able to get close to the CCDStack/Nebulosity version by using the combo below minus the application of CIE XYZ because that nuked the green channel.  Instead I just used the LRGB tool once I had applied the workspace.  Still I would like to process this the normal way...

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

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6935
    • View Profile
Re: PixInsight LRGBCombination Creating Red Smuge
« Reply #3 on: 2016 February 01 23:55:15 »
You have copied a small part of a post of mine I wrote back in 2010. From your description, it seems you are trying to perform an LRGB combination with linear data. While a YRGB combination is possible theoretically, it is not recommended, especially if you use data generated by other applications (which have probably been imported incorrectly). On the other hand, working in the XYZ and linear RGB spaces is difficult and requires you to understand more than the basics about color spaces.

I'll provide essentially the same information as in my 2010 post:

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. Many PixInsight tools allow you to apply processes only 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 brightness and contrast. A good and easy way to achieve compatibility between both images is applying STF AutoStretch transformations (through HistogramTransformation).

You have a very detailed and correct description of the whole LRGB process in PixInsight (and more) in these videos by Vicent Peris.

On a side note, as a general rule: If you really expect someone to help you here, you should upload your images, or a minimal data set where the problem can be reproduced. Posting a couple of reduced final results or screenshots does not help at all, in general.
Juan Conejero
PixInsight Development Team

Offline lucchett

  • PixInsight Old Hand
  • ****
  • Posts: 449
    • View Profile
Re: PixInsight LRGBCombination Creating Red Smuge
« Reply #4 on: 2016 February 04 14:31:54 »
Hi Juan,
In your old post you mentioned 4 steps to define a linear rgb working space.

Step 2 ( uniform illuminants matrix) seems to give errors. Is this mandatory?

Thank you!