Math: Part I
① The flow of light during the scan of a film goes as this:
- Light source creates light intensity depending on wavelength as L(w).
- This is filtered through the film base (substrate) with transparency S(w).
- This is filtered through the red-capturing pigment with transparency ρ(w)r; here r is the optical thickness of this pigment.
- This is filtered through the green-capturing pigment with transparency γ(w)g; here g is the optical thickness of this pigment.
- This is filtered through the blue-capturing pigment with transparency β(w)b; here b is the optical thickness of this pigment.
- This is caught by a camera sensel with sensitivity C(w) (depending on the type of the sensel).
The resulting effect at wavelength w is L(w)S(w)ρ(w)rγ(w)gβ(w)bC(w). The sensel records the average value of this function of w.
Conclusion Ⓐ: only the product L(w)S(w)C(w) matters, not the individual factors L(w), S(w), or C(w). (Hence it makes absolutely no sense to color-balance light source + camera without taking into account the film’s base.)
Conclusion Ⓑ: if we could manage to make the product L(w)S(w)C(w) “monochromatic” (in other words, to be concentrated at one wavelength w₀ only), then above, instead of “the average value” (which is “very non-linear” in r,g,b) one gets a simple expression L(w₀)S(w₀)ρ(w₀)rγ(w₀)gβ(w₀)bC(w₀). This immediately gives us the linear combination of r, g, b of the form r log ρ(w₀) + g log γ(w₀) + b log β(w₀). If we could also repeat it for two other wavelengths w₁ and w₂, we get 3 linear equations for 3 unknowns, so it would be easy to find the FUNDAMENTAL DATA r, g, b.
Conclusion Ⓑ₁: for best result, one should use monochromatic L(w) (since L is the only parameter one can control). Making 3 photos of the film with 3 different sources of monochromatic light allows a complete reconstruction of r, g and b using a simple matrix algebra.
Conclusion Ⓑ₂: to minimize the “crosstalk between the pigments”, the wavelengths of monochromatic sources should be as widely separated as possible w.r.t. the absorption spectra of 3 pigments. Essentially, this means “w₀, w₁, w₂ widely separated while staying near 3 peaks of the spectra of 3 pigments. (Note: they are not the peaks of sensitivity of the layers of the film!)
Conclusion Ⓑ₃: if one has no control over L, for best linearity one should mix¹⁾ the RGB-channels of the camera so that the mixes have as narrow wavelength-bands of L(w)S(w)C(w) as possible.
¹⁾ In some situations, there are reasons to avoid mixing camera channels with some coefficients negative. Moreover, the situation when the sensitivity C(w) after mixing may take negative values is especially risky. However, the scanned film has quite narrow “output gamut”. Because of this, using negative mixing coefficients is OK as far as all 3 mixed channel in actual film images remain positive. (Having them positive is crucial since the next step involves negative powers!)
Conclusion Ⓑ₄: One should use mixes of RAW RGB-channels R₀,G₀,B₀ like R = R₀ - 0.1 G₀, G = G₀ - 0.1 R₀ - 0.1 B₀, B = B₀ - 0.1G₀. (I expect that 0.1 may be increased even more.)
Conclusion Ⓑ₅: If the light source is mostly concentrated at 3 frequencies not very far from the camera sensels’ peaks of sensitivity, the procedure of Ⓑ₄ can be tuned to match exactly the procedure with 3 monochromatic light sources.
⁜⁜⁜⁜⁜⁜ In what follows, I ignore non-linearities coming from L(w)S(w)C(w) being not narrow-band ⁜⁜⁜⁜⁜⁜⁜
② Note that one can find L(w₀)S(w₀)C(w₀) from scans of the unexposed part of the film. Same for w₁ and w₂. Dividing R, G and B by these “offsets” would “cancel” the effects of backlight+film␣base+camera
giving products R’ = ρ(w₀)rγ(w₀)gβ(w₀)b, likewise G’ for w₁ and B’ for w₂.
Conclusion Ⓓ: one can find “the opacity of the red pigment” er as a product (R’)ᵏ(G’)ˡ(B’)ᵐ for appropriate k,l,m. Likewise for eg and eb with appropriately modified values of k,l,m.
Conclusion Ⓔ: in fact, the effects of cancelling L(w₀)S(w₀)C(w₀) on er, eg, eb is multiplication by certain constants. So instead of er = (R’)ᵏ(G’)ˡ(B’)ᵐ one may use er = RᵏGˡBᵐ/c₀, which may be rewritten as (RG-LB-M)-K/c₀. Here the constant c₀ depends only on the type of film (and can be found where r=0: on the unexposed part of film).
Note that considering RG-LB-M “cancels the cross-talk between pigments” on frequency w₀, and the exponent -K reflects the power-law dependence of the “sensel output” on er.
This finishes the process of reconstructing the density of pigments in the film. Recall the steps:
- ⓐ Recalculate RAW channels R₀, G₀, B₀ linearly into “narrow-band” variants R, G, B “cancelling” the RAW channels cross-talk.
- ⓑ Calculate the “biased” opacity of each pigment (RG-LB-M)-K, likewise (R-VGB-W)-U and (R-IG-JB)-H (with appropriate K,L,M,U,V,W,H,I,J). This “cancels” the cross-talk between the pigments. (This is linear in log R, log G, log B, r, g, and b.)
- ⓒ Calculate the “true opacity” of the pigments (RG-LB-M)-K/c₀ (etc., here c₀ is the value of (RG-LB-M)-K on the unexposed part of the film).
Note that division by c₀ is equivalent to white-balancing in the midtones. Indeed, er (etc.) depends linearly on the exposure of film to the (red) light. (This presumes the correct choice of the power K, and holds in midtones, where the law of exposure → opacity=er is very close to linear. For many types of film this linearity also works in highlights.)
⁜⁜⁜⁜⁜⁜⁜ How to continue ⁜⁜⁜⁜⁜⁜⁜
③ Explain how to find the cross-talk coefficients L, M, V, W, I, J.
④ Explain how to find exponents K, U, H (essentially, the slopes on the optical density → pigment plots).
⑤ Recalculate er, eg and eb into the amount of light captured by each of 3 sensitive layers of the film.
However, these are completely different processes, so it is better to postpone them to a different post. Moreover, I see no simple way to do ③ — except for using some “reasonable values”, like 0.1 used in ⓐ :–(.