Custom weightages for color channels in RGB compositing

Would be very useful.

Is this planned / likely in near future?


This is already done with the color. You can weight each channel by playing with the attributed color.

If you want an image to contribute to 100% to blue and 30% to green, you can associate a colour to it that contains 100% blue and 30% green, but it has to be done in hexadecimal currently in the custom colour window, something like #0064ff

A tutorial is in the making.

Look forward to the tutorial.

Am unable to locate the custom colour window UI referred to. How do I get to it?


Thats the white balance? I want to say Red channel should have 60% of Image A and 40% of Image B.

No. The color window. Click on a color and you can change it.

Sorry, I dont understand.

I enclose screenshot of unsaved composited image.

I can change the color ratios for RGB by adjusting the sliders marked in red for an individual color

But a) this is not precise and b) it only does for r,g,b channels, not the others or luminance.

So it does not help in the requirement of allocating x% of image to Y channel. Ideally there would be possibility of putting percentage numbers in the area highlighted in yellow.

So where do I put the hex numbers mentioned by Vincent?

Thank you

Okay found it. have to click the little colour icon in the Image Compositing dialog, right?

Would still be nice to have it the other way round - that is, for each channel, say how much from each image, totalling to 100% of course.

That’s it, sorry. Yes it would be nice… I hope someday I’ll do it.


Please do put up the tutorial on generating the hex values when you can.


EDIT: Could you just confirm the weightages that SIRIL assigns to each layer by default when compositing?

Tutorial should be there tomorrow.
The weights depend on the colour you chose. A full red will give 100% of the associated image in the red channel of the result.

I meant while adding the channels. Let me put the question this way. I have 3 images, A, B and C.

First select A in the color window, and choose a custom color which is 50% red and 50% green.

Next select B, and choose a color 50% green and 50% blue.

Finally, select C and give custom color 50% red and 50% blue

In the composite image, will Red channel be 50% of A and 50% C, Green be 50% of A and 50% of B, and Blue be 50% of B and 50% of C?


Great. So while it needs a little calculation, can use this approach for the original objective.

Yes. Here is the RGB composition tutorial!

Thank you - very well explained and helpful.

One suggestion - normally users may like to do the colors the other way - eg 30% of red from image A and 70% from Image B.

To do this, a table will have to be built, colors as rows and images as columns, with each column and row totaling to 100%. Then the colors for each image can be done based on that.

Is that something feasible to add to the tutorial, or do you think it would cause more confusion than clarity?

Heres my calculator in excel.

One point in tutorial - 30% of 255 is shown as 64, but in online calculator referenced it is 4C.

Step 1: Distribute each image over channels
Image1 Image2 Image3
Red 100% 30% 0%
Green 0% 70% 50%
Blue 0% 0% 50%
Total 100% 100% 100%
Step 2: Examine the contribution of each image to each channel
Image1 Image2 Image3 Total
Red 77% 23% 0% 100%
Green 0% 58% 42% 100%
Blue 0% 0% 100% 100%
Step 3: Change values in Step1 till output in Step 2 is acceptable
Step 4: Take hex color values from below for each image
Image 1 Image 2 Image 3
Hex code FF0000 4CB200 007F7F

That’s right, I don’t know where I got the 64 from… Thanks for noticing.

I think the tables will be misleading, the first step is not a good thing to do I believe. Users should directly do step 2.

That’s because SIRIL only allows entry as per Step 1 - that is, what percentage of each image goes to which channel.

Step 2 is auto-calculated to give the output the other way round - what percentage of each channel comes from which image.

Example, in this case,

  1. Image 1 has a color of 100 red. Image 2 gives 30 red and 70 green.
  2. So Red channel has 100 from Image 1 and 30 from Image 2.
  3. Normalizing to 100 means Red is 77% from Image 1 and 23% from Image 2.

User has to do trial and error in Step 1 till they get desired output in table 2.

The final custom colors to give per image are auto calculated in Step 4. This is only a conversion to hex of the percentages.

Is this logic not correct?

I do it the other way: which images do I want to contribute to red and how much? then set a colour to those images based on the answer. You should not set a 100% red to an image if you know you will have another image contributing to the red output.