PDA

View Full Version : Three questions about color mixing


zee944
16th January 2009, 15:51
I have a few questions about color mixing & calculating.

http://i179.photobucket.com/albums/w286/zee944/colormixingquestion.jpg

Question I.: The original color is (120, 120, 120). In the first example I've increased Green amount by 20 (120, 140, 120), in the second, I've increased Blue by 20 (120, 120, 140). There's luma difference between the the results, since the luma depends on the Green component mostly. (120, 140, 120) is brighter than (120, 120, 140). Does it matter? Which is closer to the original for the human eye?

Question II.: The original color is (160, 160, 160). If the components are adjusted in the same direction (increasing both the Red & Green), will the result be closer to the original color compared with adjusting them in the opposite direction (increasing Red and decreasing Green)? It seems obvious from the example above, but I still have to ask.

To cut a long story short: how can I figure out how close two colors are? Is there a reasonable formula for that?

Question III.: Let's say we have an original image, and a filtered one. The colours on the filtered one are heavily adjusted, replaced, touched-up with professional tools, so it is impossible to do it back. (Pls don't even consider that - it's not the point of the theory!)

Let's assume I've already found out these equalities:

original ................................................. filtered
(R, G, B) .............................................. (R, G, B)
140, 88, 212 ......................................... 220, 70, 205
155, 136, 44 ......................................... 135, 80, 23
8, 45, 36 .............................................. 10, 38,76
85, 63, 205 ........................................... x, y, z

How can I find out the approximative filtered values of the last one? (x, y, z)
(It's just a short-in-the-dark sample, what I'm really curious of is the mathematic formula.)

Any help wil be appreciated. :)

hanfrunz
16th January 2009, 16:49
that is not that easy, because in professional colorgrading you don't use one formula to correct the whole frame! A lot of tools can only alter shadows, midtones and highlights. So lets say you push shadows to blue, but highlights to red. Then it's impossible to calculate any values. Also masks could be used (brighten up a face...)

Regards,
hanfrunz

Gavino
17th January 2009, 12:23
how can I figure out how close two colors are? Is there a reasonable formula for that?
One way to measure the difference between two colors would be to express them in (U, V) terms and take the distance between them in the U, V plane, ie sqrt(dU^2+dV^2), where dU and dV are the differences in U and V respectively.

I don't know if this corresponds exactly to what we might subjectively view as color difference, but it should be along the right lines.

IanB
17th January 2009, 14:39
Generally the eye is very sensitive to differences in hue, moderately sensitive to luminance changes and not so sensitive to saturation changes.

The relative sensitivity changes with the actual values, i.e. at low saturations the eye is more sensitive to change in saturation. Skin tone hues are very sensitive, blues not so much. At low luminance the colour shades are less noticeable.

So for the YUV model, hue is analogous to the vector angle in the UV plane, i.e. arctan2(u, v).

Saturation is analogous to the vector length in the UV plane, i.e. sqrt(u**2 + v**2).

Luminance is analogous to the Y value.

So colours are similar if the u1/v1 == u2/v2, y1 ~= y2 and u1**2 + v1**2 ~~ u2**2 + v2**2

== is equal
~= approximately equal
~~ roughly equal

Mug Funky
20th January 2009, 04:12
like hanfrunz says, there's so many ways to modify colours (not just offsets) that the only way to see how "close" things are is with a framestore, a waveform monitor and a vectorscope (and a decent monitor and operator as well). switching between a reference image and a "current frame" will quickly reveal how close you are. the matching is done with fine adjustments and eyeballing, preferably using purpose built control surfaces (grader's balls :)).

tritical
20th January 2009, 06:09
To cut a long story short: how can I figure out how close two colors are? Is there a reasonable formula for that?
If we are talking about blocks of solid color, the most recent color difference formula meant to approximate human perception is CIEDE2000. However, it is a very complicated formula based on CIELCH colorspace, which is a cylindrical version of CIELAB. The CIE94 color difference formula (predecessor to CIEDE2000) also uses CIELCH, but is much simpler to compute. The simplest formula that still gives good performance is CIE76, aka DeltaE, which is simply the squared error in CIELAB colorspace. You can find more here: http://en.wikipedia.org/wiki/Color_difference. This might be more complicated than you are looking for though.

zee944
30th January 2009, 18:02
The simplest formula that still gives good performance is CIE76, aka DeltaE, which is simply the squared error in CIELAB colorspace. You can find more here: http://en.wikipedia.org/wiki/Color_difference.

Thank you guyz, especially for Ian and tritical for the more practical approach.

It's indeed a lot more complicated then I thought, I have to find out how to use the DeltaE formula. Wikipedia says RGB cant't be simply converted to CIELAB format, but there must be some resolution to it...