Please help me to understand "Channel Mixer"

I hear you, the different colors in certain channel provide different density. For example in red channel 1% green may produce 1.5% red (a hypothetical value).

BUT, do you think I am still be able to just manipulate RGB to produce exactly the same color? If so I still don’t get the point why I need to change other color value in the channel.

That doesn’t make sense to me, probably because it’s wrong, but I can’t be sure it’s wrong as it doesn’t make sense to me :wink:

Use this photo to test channel mixer settings on:
http://rawtherapee.com/shared/test_images/colortarget/Pentax%20K-5%20daylight.dng

Use the colorwheel:

  1. Apply the (Neutral) profile, zoom right into the blue patch.


    What do you expect will happen if we tell RawTherapee to “add some of the values from the blue channel into the red channel”? Looking at the color wheel, I expect the blue color to shift in the direction of red, so I expect blue to change to purple.

  2. Using the channel mixer set the blue component of the red color (blue dot in red circle) to 50.
    What happened?


    Blue changed to purple as expected. But simply increasing the brightness of the red channel (because we added some of the values from the blue channel into the red channel) means that all colors will shift to red. Did that happen?

    Yes, the whole image has a reddish color cast. Look at the bottom row of what used to be grey patches - they be pink.

  3. To remove the color cast, you must subtract from the red component of the red channel the same amount you added to the other components in the red channel.
    We set R(B)=+50, so we must subtract 50 from R(R).


    Et voila, neutral colors restored, and blue is still shifted towards red, making it purple.

Ditto for the rest.

6 Likes

You will not be able to replicate the effect of adding another channel value to the Red channel (for example) by simply modifying only the Red channel Reds. That is, adjusting the blue slider in the Red channel will produce an effect that you cannot get by only modifying the red slider in that channel.

The effect from this modification could technically be reproduced using color curves, but I certainly wouldn’t want to do it. :wink:

Mr. Fancy-pants,

I’m new here and relatively new to the concept of color channels and using them to adjust overall color in an image. I’m afraid that I just don’t get this. I’ve read the article from earlier in this thread and I’ve Googled and read several other articles that attempt to explain color channels but none of them make any sense to me. The article referenced above immediately clicks the monochrome check box once it gets to the channel mixer so it neglects to answer my questions.

I get that there are different color models and color spaces and that an image can be broken down into red, green, and blue elements. What I don’t get is how the “red channel” can have a green and blue element or value or level. Every explanation I’ve found about color channels starts by explaining color models and then goes on to break down an image into three colors. When they explain RGB they show that pixels are made up of three colors and changing the intensity of any one of those three colors in a pixel results in a different shade. I get that. It makes sense. But then when they talk about color channels they all explain it as if the red color channel is only the red value of each pixel. So if there is no red in a certain pixel than the red channel would be black. If the red channel is only the red value in a pixel, then how can you adjust the green or blue in the red value? And, why would adjusting the blue value of the red channel cause blues to turn purple. I realize that it does work, I just don’t get why and nobody seems to be able to explain it. All that anyone can do is use examples to show that, for example, blue turns to purple when you increase the blue in the red channel. I guess if I experimented with this long enough I could just train myself to know what effect changing these levels will have, but that still won’t help me to understand why they have the effect they do.

What is a channel? Clearly it’s not what I think it is. There is some major abstraction taking place here and none of what I’ve read seems to explain it. I apologize if I’m being really hard headed about this but I really want to understand it. I think what would be helpful would be for it to be explained on a pixel by pixel basis. For example, if I have a pixel with an RGB value of R50-G200-B10 and I change the blue level of the red channel, what will I end up with? It’s been pointed out that just adjusting RGB levels can’t achieve the same results as using the channel mixer but after you’ve made adjustments using the channel mixer, your pixels will still have an RGB value and I assume it will be different in some way from the original. I imagine that the algorithms used to make those adjustments are very complex but in the end, isn’t that all that is really happening? Are the channel mixer adjustments not just changing the RGB values in individual pixels?

I guess it’s really just the abstraction that’s confusing me. How can adding blue to the red channel make blue colors look more red? That’s counter-intuitive.

4 Likes

Based on @patdavid’s explanation above, if I understand correctly:

Increasing the red slider in the red channel:
boosts the red channel (making the resultant image more red) based on the tonal information in the red channel itself.

Increasing the green slider in the red channel:
boosts the red channel (making the resultant image more red) based on the tonal information in the green channel.

I’ve not done the second type of operation myself, but I imagine it’s often a subtly different way of controlling colour. The more the green/other channel differs from the red/adjusting channel, the more different it will be.

It’s not blue that’s added to the red channel, but a portion of the blue channel’s tonal data/numbers. (The portion/amount added is controlled by the slider.) And so the red channel is increased as compared to the blue (and green) channel.

2 Likes

@tstoddard - don’t get too caught up in the idea of color models/spaces just yet. It can be counter-intuitive to wrap your head around but at the end of the day the biggest things to keep in mind is

adjusting each channel in the mixer (red, green, or blue) will only adjust how “bright” that particular color is.

You won’t be adding any other colors into the mix. The channel mixer only let’s you adjust how intense that particular color is.

Hopefully I can clear this up. Let’s consider four “pixels” that are only made up of a Red and Green channel (we’re ignoring Blue for the moment to simplify things) that go from 0 – 255.


From left to right, we are going to set their initial Red, Green values as:

First: 127, 0
Second: 127, 64
Third: 127, 127
Fourth: 0, 127

So, let’s look at modifying only the Red channel in the channel mixer. I’m going to use GIMP for this example but the theory should be the same everywhere.

So on the Red channel, let’s push the Green contribution up to “50”.

What I would expect from this is to take the Green channel value for each pixel, multiply by 50%, and then add it to the Red channel.

First Pixel

So let’s look at the First “pixel”.

It’s values are R = 127 and G = 0. So…

  1. Multiply Green channel value by 50%:
    0 × 0.50 = 0
  2. Add the result to the Red channel value:
    127 + 0 = 127

The final result of this operation on the pixel will be nothing:
R, G = 127, 0

Second Pixel

The second pixel has something interesting finally happening to it.
Remeber, it’s values are R = 127 and G = 64.

  1. Multiply Green channel value by 50%:
    64 × 0.50 = 32
  2. Add the result to the Red channel:
    127 + 32 = 159

The final result of this operation on the Second pixel will be:
R, G = 159, 64

Third Pixel

The third pixel has it’s values as R = 127 and G = 127.

  1. Multiply Green channel value by 50%:
    127 × 0.50 = 64
  2. Add the result to the Red channel:
    127 + 64 = 191

The final result on the Third pixel is:
R, G = 191, 127

Fourth Pixel

The fourth pixel has no Red in it: R = 0 and G = 127.

  1. Multiply the Green channel value by 50%:
    127 × 0.50 = 64
  2. Add the result to the Red channel:
    0 + 64 = 64

The final result on the Fourth pixel is:
R, G = 64, 127

If we actually do this in GIMP, we see that this is exactly what we get (notice that the Green channel hasn’t changed at all in this only the Red channel).



Top, after channel mixer +50% R(G), bottom original.

If we go further and instead adjust the Red channels Green contribution, R(G), up to 100%:

First (R, G): 127, 0 ⟹ ( 127 + (0 × 1.00) ), 0 ⟹ 127, 0

Second: 127, 64 ⟹ ( 127 + (64 × 1.00) ), 64 ⟹ 191, 64

Third: 127, 127 ⟹ ( 127 + (127 × 1.00) ), 127 ⟹ 254, 127

Fourth: 0, 127 ⟹ ( 0 + (127 × 1.00) ), 127 ⟹ 127, 127

Which is what we see when doing the operation in GIMP:



Again, in all cases, notice that the Green value doesn’t change - we are only modifying the values of the Red channel.

Hopefully this makes sense?

8 Likes

Any slider in the Red channel can only affect the R value of your output pixel. Likewise, any slider in the Green channel can only affect the G value of the output pixel, and any slider in the Blue channel can only affect the B value of the output pixel.

Your input values are R50 G200 B10

Normally
the Red channel sliders are R100 G0 B0 this means 100% of 50 + 0% of 200 + 0% of 10. Output R=50
the Green channel sliders are R0 G100 B0 this means 0% of 50 + 100% of 200 + 0% of 10. Output G=200
the Blue channel sliders are R0 G0 B100 this means 0% of 50 + 0% of 200 + 100% of 10. Output B=10
so your output pixel = R50 G200 B10 = input values = unchanged

Lets change the red channel sliders only, remember this can only affect the R value of the output pixel.
Red channels sliders are now R0 G0 B100 this means 0% of 50 + 0% of 200 + 100% of 10. Output R=10
Green channel sliders are R0 G100 B0 this means 0% of 50 + 100% of 200 + 0% of 10. Output G=200
Blue channel sliders are R0 G0 B100 this means 0% of 50 + 0% of 200 + 100% of 10. Output B=10
so your output pixel = R10 G200 B10

Lets change the R channel some more.
Red channels sliders are now R0 G50 B100 this means 0% of 50 + 50% of 200 + 100% of 10. Output R=110
Green channel sliders are R0 G100 B0 this means 0% of 50 + 100% of 200 + 0% of 10. Output G=200
Blue channel sliders are R0 G0 B100 this means 0% of 50 + 0% of 200 + 100% of 10. Output B=10
so your output pixel = R110 G200 B10

Why would adjusting the Blue slider of the Red channel make blues purple?

Input R0 G0 B255 = pure blue

Red channel sliders R100 G0 B100 which means 100% of 0 + 0% of 0 + 100% of 255. Output R=255
Green channel sliders R0 G100 B0 which means 0% of 0 + 100% of 0 + 0% of 255. Output G=0
Blue channel sliders R0 G0 B100 which means 0% of 0 + 0% of 0 + 100% of 255. Output B=255
Output pixel = R255 G0 B255 = pure magenta

HTH

James

Edit: And Pat beat me to it, with pictures and everything :slight_smile: and this was my first real post too.

3 Likes

Hi James:

This is the most clear answer for the topic I am searching for. Especially

Your input values are R50 G200 B10

But again, back to one of my previous question in the same thread

There are many bundled processing profiles in RawTherapee, I checked some of them the way they manipulate color is to play with all the colors in all channels. For example the “faded golden 1” will set:

  • red channel: r=60, g=0, b=20
  • green channel: r=0, g=60, b=20
  • blue channel: r=-20, g=20, b=40

Based on your formula, I should get

  • Red: 0.6050 + 0200 + 0.20*10 = 32
  • Green: 050 + 0.60200 + 0.20*10 = 122
  • Blue: -0.2050 + 0.20200 + 0.40*10 = 34

So if I set the slides to:

  • Red: R64, G0, B0
  • Green: R0, G61, B0
  • Blue: R0, G17, B0

It should produce same color?

@patdavid and @james, thanks for the great answers to my questions. It’s starting to make a lot more sense to me now. I’ve been reading various tutorials and articles about the channel mixer and this is the first explanation that I’ve found that clearly explains what is happening.

Thanks again!

1 Like
  1. Why are you scaling your slider results? If you wanted the same result as “faded golden 1” you can set the sliders to R32, G122, B34.
  2. This is the most important thing: this will make the example pixel value like “faded golden 1” only for this one pixel (R50 G200 B10).

Pretend the very next pixel has a value of R100 G150 B10. Applying your “faded golden 1” channel mixer values to it yields:

Red: 0.60100 + 0150 + 0.2010 = 62
Green: 0
100 + 0.60150 + 0.2010 = 92
Blue: -0.20100 + 0.20150 + 0.40*10 = 14

Which is not the same thing as setting the sliders directly to R32 G122 B34…

You will not be able to replicate the color across your entire image to match the “faded golden 1” preset by only modifying the associated color slider with the channel (reds on red, greens on green, blues on blue).

Hi Hardywang,

I have used a simple mathematical model to demonstrate the concept.

For Rawtherapee it appears the maths is different**. There may be some non-linear scaling or normalization taking place, I don’t know, but please don’t let this confuse you, the concept described in mine and Pat’s previous posts is still valid. They correctly demonstrate the behaviour of the sliders for the channels, it is just that the actual output values are slightly different.

So yes, with my simplistic model and a single input colour of R50 G200 B10, your slider values would produce the same output colour as “faded golden 1”, however for other input colours they would not produce matching output colours.

** I generated an 8bit tiff with paint.net filled with the input values R50 G200 B10. I then loaded this tif into Rawtherapee. Unmodified, Rawtherapee’s RGB percentages are near enough correct. (I don’t know why RT uses % for RGB values). Applying the slider values of “Faded Golden 1”, saving as an 8bit tiff and loading into paint.net shows unexpected output values of R42 G161 B64.

James

1 Like

The RGB values you see in the Navigator panel depend on the working colorspace. If you set it to sRGB the numbers will look as expected. The default space is ProPhoto though and using it the numbers are different.

RT uses for RGB values because makes sense when working in 32-bit floating point precision. 0-255 only makes sense for 8-bit integer precision.

1 Like

@hardywang First of all thanks for starting this topic! RGB Channels is one of my favourite tools in RT (mostly because it enables me to do some Jose Villa shooting Fujifilm 400H film magic to images by making greens bluer and by making skin tones goldener by taking blue out of red)

The image is not mine btw :stuck_out_tongue: it’s from one of Jose Villa’s Workshops as per link above.

Anyway…

I find this thread useful, because it helps me wrap my mind around what RGB Channels actually does. Most articles online seemed helpful but not altogether fully enlightening, so I mostly play it by ear and make things work to look okay without knowing 100% for sure what I’m doing (shh don’t tell my clients).

The way I see it: (Please forgive my ignorance good people, where ignorance may be, and yes, critique and corrections are welcome)

RGB Channels is a tool that lets you define how much of each initial colour is placed in each channel. As an example, the RED channel would be as such:

Red Channel: (what I called initial colour -or all the red that’s available)
Red: 100% – (here I distribute 100% of it)
Green: 0% – (here I distribute 0% of it)
Blue: 0% – (here I distribute 0% of it)

This would mean, since we talk about the red channel, we discuss how much red we put in each channel. So according to the above, we put all of the red channel (all the red colour there is to be worked with) into the final red output, while none of the red is added to the final blue output or green.

It took me a while to figure this out, so that’s why I am over-stressing it. There are two reds; one is the altogether redness that is in the beginning, and then there is the final red amount for pixels. This sounds confusing even to me, so let me use a different example; My turning the greens bluer for filmy effect. Here’s what I do:

Red Channel:
R: 100
G: 0
B: 0

Green Channel:
R: 0
G: 100
B: 0

Blue Channel:
R: 0
G: +40
B: 100

So the way I think of it when I do this is the following; I go to the channel that I wanna do stuff with, in this case it being blue; and then I do stuff with it, in this case add some into green, in this case adding +40 in the green section of Blue Channel.

Considering the previous comment by @Morgan_Hardwood about how making changes to colour channels, I guess I would have to cancel out the channel imbalance by also making the B: 60 (because 100-40=60).

This seemed a bit counter intuitive to me at first: I used to think; "If I wanna add blue to the green tones, well I’ll go to the Green Channel and make it had more blue in it, such as

Green Channel:
R: 0
G: 100
B: +40

but this turned out would add green channel to blue output.

So if I got this somewhat right, the rule of thumb is this:
When dealing with RGB Colour Channels in RawTherapee; when you look at one of them, say Red Channel, you think that this is the colour you are about to work with; and when you edit the R, G, B values within it, you think of those as where you add said channel to.

P.S.:
I’d still love to have sliders that allow you to modify the hue of basic Red, Green, and Blue to other hues, Photoshop/Lightroom style :stuck_out_tongue: But that’s another topic…

9 Likes

Hello,
I’m not sure I’m posting in the right topic but I need help with the channel mixer in RawTherapee. When I change the values, absolutely nothing happens to my picture. I can’t understand why.
I hope someone here will be able to help me.
Thanks.

Good evening, @alexis & welcome to the forum!

This may be a silly suggestion, but have you turned the little on/off indicator on? You know, the little ring immediately to the left of the text Channel Mixer:

on

Have fun!
Claes in Lund, Sweden

2 Likes

Hi Claes.
It was as simple as that… :stuck_out_tongue: I had no idea you had to click on this tiny circle to activate the mixer. I just started working on RAW format.
Thank you for your help !

1 Like

To be on the safe side: this on/off thing can be found in (almost) every module!

I just have to say that I’m very happy that this this thread got necromanced. I could never figure out how the channel mixer in RT worked.

Now I understand what it’s doing, thanks to Pat’s explanation. But I couldn’t figure out the practical application, until I got to @stefan.chirila’s post about making greens look more blue, and it was funny, because last night I was trying to do exactly that, make green plant foliage more blue.

I was messing around with a photo, and only know about the LAB HH adjustment, and the HSV equalizer. I just tried the “channel mixer” technique, and still prefer my results with HSV in this particular picture, but it’s a good tool to know about.

3 Likes

Indeed. Thanks for the quick answer. :wink:

thanks for tagging me! I love the RGB channels too; though I dislike the fact that you have to be careful when adding, that you have to also subtract an equal amount …or the balance is shifted. I wish we had a checkbox that did that for you. It is relevant to keep in mind that results will be different from HSV or HSL because those only work on the greens, while channel mixer will blueify all the green there is in the image, even in pixels that have 20% green 70% red and 10% blue.