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:\[ C_{\mathrm{out}} = C_1 + C_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\):\[ C_{\mathrm{out}} = M \cdot C_{\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.

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} \]

Categories: Blog, Graphics stuff