James Tauber

journeyman of some

blog > 2008 > 04 > 29 >

Why Colour Correction Only Needs Two Sliders

Duncan Davidson (who I still think of as James) asked on Twitter:

Color Temp works on the Blue/Yellow axis. Tint on the Green/Magenta. No need to tweak Red/Cyan?

I responded there but decided to here as well as I've talked about colour theory before.

The basic answer is that you only need two axes because colour (disregarding brightness/luminance) is two-dimensional. Red, Green and Blue form a triangle in that two-dimensional space (with Cyan, Magenta and Yellow being on the opposite edges respectively).

Basic linear algebra tells us that, in an n-dimensional space, you only need n vectors to form a basis (actually, that's the definition of dimensionality) so you can adjust any point in two-dimensional colour space by translating it by a linear combination of any two, non-parallel vectors. Incidentally, Hue and Saturation would be almost polar coordinates on this space.

Because one form of colour modification is colour temperature, it makes sense to roughly make one of the axes the yellow-blue direction. I think the magenta-green axes is largely arbitrary. Any other axis would have done fine.

Note I say "roughly" the first time in that previous paragraph because the black-body colours aren't a straight line in standard colour models.

Hmm, that makes me wonder if colour correction sliders represent rectilinear bases at all.

UPDATE (2008-05-04): According to a reply in the Reddit thread, the slides aren't rectilinear but are based on the black-body colours. The so-called "tint" is presumably then orthogonal to black-body line (the Planckian locus)

Categories:
prev « photography » next
prev « colour_science » next

Comments (10)

JJ on April 29, 2008:

Do the axes of color have to be linearly independent? I'm thinking that it wouldn't be necessary, but would be more convenient (as changing one slider wouldn't change the effective position of the other).

James Tauber on April 29, 2008:

They have to be linearly independent. I think you're thinking of orthogonal. Yes, it would be nice to chose orthogonal axes but orthogonal in which space? CIE or Lab or ???

Matte on April 30, 2008:

Analog color correction actual does use only two slider (In this case Metal Filter that go over a light source.) that are Yellow and Magenta. By lowering or increase the amount of Yellow or Magenta light the picture can successfully be color balanced to any color scheme in the normal range. Most analog photographer are taught that using a third CYAN slider would just lower the light level (Add neutral density.) although occasion it is used in slide printing process instead of the yellow filter. To any extent in analog photography 2 slider are what is used.

James Tauber on April 30, 2008:

Another similar situation is with colour in TV signals. What is sent is B&W + two colour channels.

Interestingly, those two colour channels involve the blue-yellow and red-cyan axes, not the blue-yellow and green-magenta axes.

Image compression algorithms like JPEG take advantage of the eyes extra sensitivity to distinction in green and so use more bits for the luma channel than the two chroma channels (which, because of the choice of axes, aren't conveying any green information)

nex on April 30, 2008:

"Image compression algorithms like JPEG take advantage of the eyes extra sensitivity to distinction in green and so use more bits for the luma channel than the two chroma channels (which, because of the choice of axes, aren't conveying any green information)"
Wrong! JPEG uses more bits (and in a way also a better resolution) for luma because human eyes are more sensitive to exactly that -- luminosity -- than to colour. Yes, they're more sensitive to green as well, which is why 16bit colour modes often have 5 bits for red and blue each and 6 bits for green. But suppose you have 8 bits for red, green, and blue each. And then you decide you don't save one of these channels in a file, because you already have a 24bit luma channel. Well, it doesn't matter which channel you left out; all of the information is still there, implicitly. But what happens when you apply lossy compression to the two colour channels you kept? Well, the third -- implicitly (instead of explicitly) defined -- channel _also_ loses information, because retrieving it depends on the other two channels! So, the scheme quoted above cannot work, it's utter nonsense.

James Tauber on April 30, 2008:

nex, sorry I wasn't clear. You're absolutely right that chroma subsampling is about using higher resolution for luma than for chroma, but the choice of which two axes to use for the chroma does make a difference, doesn't it?

zBard on April 30, 2008:

The initial premise is inherently flawed. You are being misguided by the triangle representation. The triangle is not actually purely 2d - it's a cross sectional representation of the 3d structure. The "intensity" bar next to it, can be thought of as responsible for the height at which this cross sectional view is taken.

Your two sliders are not going to have singular colours varying in intensity - but will have different colours in the same slider which have to be selected.

Carrying this example further - you could have a single slider with all possible colours, and you go around selecting them : effectively a scalar list of all the the possible discrete values from which you can pick.

James Duncan Davidson on May 3, 2008:

I appreciated the twit back from you that jostled my mental model. In the intervening time since then, I've been digging into this (for a current project) and I _think_ the best answer as to why the secondary axes is Magenta/Green is the same reason LAB uses Blue/Yellow and Magenta/Green along with luminance: it models human perception. I haven't yet found it stated as such, and the tie to LAB isn't hardfast as most image editing is done in RGB space, not LAB, but it makes some amount of sense.

A second plausible reason is that, in the majority of light sources that don't resemble black body radiators, Green is exactly the component you want to subtract or otherwise tweek. Again, I haven't found hard documentation of this one the web... /sigh/

nex on May 3, 2008:

It's probably easier to think about this in terms of how you get a certain colour to show up on an RGB screen: You need a red, a green, and a blue value. These are independent of each other, hence you need three different values.

In the real world, you have light of all kinds of wavelengths, which are perceived as different colours, and you have eyes with three kinds of light receptors that are more sensitive to some wavelengths than others, but also a kind of receptor that basically just cares about luminosity. Here, you have lots of odd curves (as opposed, to simple, linear math), you have physics, biochemistry, psychology ... no way I could rush in and make (hopefully helpful) wisecracks about _that_ :-)

But back on our screen, we have R, G and B values, and we can put them through some transformation and represent them through three different values, e.g. G + R, G + B, R + B. These values don't have to be orthogonal; e.g. we could have a representation that specifies 3*G + R, G + 2*B, 4*R + 3*B. We'd still be able to figure out the values for R, G, B that we have to put up on our monitor, and we'd still be able to represent all the different colours our monitor can show. However, the three values must be linearly independent.

Imagine a format that specifies luma, yellow, and blue. To our monitor, that would be R + G + B, R + G, B. Uh-oh! Any of these values can be expressed through a combination of the two remaining ones. So actually we're only specifying two components here, not three, which is just not enough to tickle all possible colours out of the screen. That's why yellow/blue would be just one slider when luma is a given.

Thus, mathematically speaking, it doesn't matter which axes we use, as long as they're linearly independent. In practical terms, digital formats have limited precision and analog circuitry has its limitations as well, so you wouldn't want to store or transmit pictures with a weird arrangement of axes that result in significant rounding errors or noise when transformed back into R, G, B values. What exact axes you use still doesn't really matter.

Back on the topic of colour correction and the user interface elements you use for it: When you don't want luma to change, obviously now you need two values instead of three, and they still have to be linearly independent. If one slider is yellow/blue, the other one could be green/magenta, or it could also be cyan/red. Either choice is good, and I vcery much doubt one of them is more representative of human perception. (OTOH, perception of colours has been shown to depend on your native language, so ...) To the computer, it doesn't make a real difference. It just comes down to what the user prefers. Which is why your photo processing app might have six different sliders, where only two are technically needed. You could have even more sliders. One day you might want to balance yellow against blue, another day you might rather want to balance orange against blue.

Now, whether colour is two-dimensional or not depends on your definition of colour. To a painter who thinks in terms of hues, tints, shades, saturaion, ..., it may have more than two dimensions. Two a child choosing from a rainbow of crayons it may have one dimension. But to a photographer who colour-corrects a shot, it does have two. The fact that the "triangle representation", which neatly maps onto the colours a screen or print can show, doesn't quite cover all possible colours we can see has little to do with that.

Created: April 29, 2008
Last Modified: May 5, 2008
Author: James Tauber