I have no clue how channel mixer works

Although I have watched several times videos from Boris and Bruce and a read the darktable user manual I still struggle with the understanding of the channel mixer.
I made a very simple R, G, B png image (picture 1)
If I move the “input G” slider in the the “R tab” to the right, the green area turns into brown and in the histogram a red pin appears (picture 2). Why does red appear in a pure green field? Is this a png issue, or am I…?

Thx for your valuable answers


You have input and output channels… so even though you are in an r g or b “channel” if you are in the red output channel all that gets impacted is red…

The Channel Mixer.pdf (68.9 KB)

1 Like

thx for the document. It supports my understanding, but makes my shown experiment even harder to explain.
br
christoph

No not at all your green bar comes in on my pc around 52 green … so 0 52 0… when you set the green slider to 2.0 you multiply this by 2 and add it as red since you are in the red output… so the pixel is now 104 52 0… ie the color that you see…

And the other bars have little to no green so they will not change much if at all…

The way I’ve thought of it (and I’m sure there are many ways to visualize / conceptualize it) is the channel mixer determines the “purity” of each output channel’s color. If you have a pixel that’s 100% R, 100% B and 100% G, it’s white. If it’s 100% R, 100% B and 0% G, it’s magenta. But if the red channel has been adjusted to now contain some other input color in addition to red, then it’s skewed and the final color will shift.

In other words, the output channels are “conduits” through which theoretically a percentage of pure R, G and B will “flow” (per conduit). But the channel mixer can “pollute” each output channel by de-purifying a color though the addition of other colors. So while the percentage of “red” might not change, its inherent “redness” might, which will affect the final color.

Someone please correct me… I know it’s coming. LOL :flushed:

I just think of them as simple multipliers… You are going to enhance red with + values and decrease it with - ones for the red output channel… the extent to which that happens and the resulting color will rely on the values of the pixel so pixels with a large blue number will add more red to the final pixel value than ones with less blue when you bump the blue slider and the same for green, and well red in the red output channel is pretty obvious… i guess whatever way you think about it to understand it…

Make sure you enable color calibration with the basic channer mixer preset:
image

or that the CAT tab is set to adaptation: none (bypass) (basic channel mixer has it set up like that):
image

Otherwise, if I remember correctly, you won’t be mixing R, G, B, but components from some other colour space.

The channel mixer mixes the channels and not the colors.
It’s just a matrix multiplication.
(Rout, Gout, Bout) = M *(Rin, Gin,Bin) for each pixel

Imagine a pixel with (Rin, Gin, Bin)=(0,1,0) pure green
Then , as you described : “you move the “input G” in the R tab”, the value becoming for instance 0,5 instead of 0

It means that Rout = 1*Rin + 0,5*Gin+0*Bin
For the above pixel Rout = 0,5, Thus the color changes from
(0,1,0) to (0,5,1,0) and you put some red in the green patch.

Note:What I dont know is in what color space it is applied : working space or output space.

priort explains it well.

Consider just the pixel where your cursor is located. In the first image, the RGB value of that green pixel is RGB = (0,60,0) (on my machine). These are the red, green and blue “input” values for that pixel. You have selected the “R” tab in the color calibration module, which means you are going to modify only the red value of that pixel by a mixture of the input values corresponding to the coefficients of the sliders (1.0, 2.0 and 0.014). Therefore, the new red value (the output) becomes R_out = (1.000 * 0) + (2.000 * 60) + (0.014 * 0) = 120 and the modified RGB value for that pixel now becomes RGB = (120,60,0). The color turns brown.

Now consider a pixel in the red region of the input image. It would have an input RGB value of say RGB=(120,0,0), i.e, no green. The output red value is modified as before so it becomes R_out = (1.000 * 120) + (2.000 * 0) + (0.014 * 0) = 120. Notice it has not changed because there was no green in the input. Therefore, the RGB value for that pixel is also unchanged, i.e, RGB = (120,0,0), and the color stays red.

A find that this video provides a nice explanation [ENG] Channel Mixer Part 1 - YouTube

2 Likes

Thx to all of you for your very supportive explanations. I think I got it.
Maybe it would be helpful for my brain, if the channel mixer UI looked a little bit like the matrix equation. Meaning: the R, G, B tabs as lines instead of columns, and the input sliders in columns instead of lines. But not sure if this makes sense. :slight_smile:

matrix equation

1 Like

You can find many tutorials on channel mixer in various software, because it’s the same in all tools (Gimp, Photoshop and so on).

Look at youtube InAffinity for Affinity Photo - channel mixer. There are few videos

thx