Color mixing ed

How do colors interact? What is "subtractive color mixing"?

Simplification: we'll assume that there are only 3 independent wavelengths (colors: red, green, blue). Real life is messier, because these 3 perceived colors can have some overlap in the spectrum.

Multiple light sources ed

For a single wavelength, the intensities (energy) from two sources will just add up.

Physical reason: the equations of light (Maxwell equations) are linear.

Three independent wavelengths will add similarly:\[ L_{\mathrm{out}} = L_1 + L_2 = \begin{pmatrix} r_1 \\ g_1 \\ b_1 \end{pmatrix} + \begin{pmatrix} r_2 \\ g_2 \\ b_2 \end{pmatrix} \]

Single light with matter ed

Transmission (transparent light filter) ed

Shining a single wavelength onto a transparent material, only a certain percentage will come out on the other side. The rest will be absorbed or reflected.

Physical reason: a thorough explanation would require some quantum field theory. Let's not do that.

For 3 color components, we can find 3 transmission factors \(0 \le R,G,B \le 1\), combined into a vector \(M\):\[ L_{\mathrm{out}} = M \cdot L_{\mathrm{in}} = \begin{pmatrix} R \cdot r \\ G \cdot g \\ B \cdot b \end{pmatrix} \]

Reflection ed

This can happen for different reasons: metals really reflect while most other materials reflect by diffuse sub-surface scattering (light entering the material, traveling some distance with filtering, and then exiting).

Either way, we get a single percentage for each color component and the same formula as for transmission.

Mixing materials ed

This is usually sloppily called "subtractive mixing". Sadly, the term is applied to several different situations, with very different behavior.

Multiple transparent filters ed

We already know how to solve this:

Any light going through the first filter gets multiplied by its coefficients. Then, going through the second filter, we have to multiply again. Overall, this behaves like a single filter with the coefficients multiplied:\[ M_{\mathrm{combined}} = M_1 \cdot M_2 = \begin{pmatrix} R_1 \\ G_1 \\ B_1 \end{pmatrix} \cdot \begin{pmatrix} R_2 \\ G_2 \\ B_2 \end{pmatrix} \]

Examples
blue (0, 0, 1) and yellow (1, 1, 0) = black (0, 0, 0)

red (1, 0, 0) and orange (1, ½, 0) = red (1, 0, 0)

red (1, 0, 0) and cyan (0, 1, 1) = black (0, 0, 0)

In the real world with cheap filters we would get

blue (0, ¼, 1) and yellow (1, 1, ¼) = dark green (0, ¼, ¼)

Multiple strong pigments ed

If there are two types of reflective pigments, and each ray of light only gets reflected by exactly one pigment with 50/50 chances, we get\[ L_{\mathrm{out}} = M_1 \cdot \frac{1}{2} \, L_{\mathrm{in}} + M_2 \cdot \frac{1}{2}\, L_{\mathrm{in}} \]or\[ M_{\mathrm{combined}} = \frac{1}{2}\, M_1 + \frac{1}{2}\, M_2 \, . \]

Categories: Blog, Graphics stuff