POV-Ray : Newsgroups : povray.advanced-users : Reconstructing full color pigment pattern : Re: Reconstructing full color pigment pattern Server Time19 Jun 2021 06:17:49 EDT (-0400)
 Re: Reconstructing full color pigment pattern
 From: Bald Eagle Date: 16 Jul 2019 14:50:01 Message:
```So, I read a lot of posts about RGBA, and alpha compositing, etc, and I also
remembered that clipka weighed in with:

http://news.povray.org/povray.binaries.images/thread/%3Cweb.57a7e643418f435e7df57c0%40news.povray.org%3E/

So, considering alpha=1 is opaque and alpha=0 is clear, it looks to me like
POV-Ray's "transmit" is simply (1-alpha).

Now, calling surface "A" and background "B", and rearranging (for consistency
with the alpha compositing links) clipka's

Color[result] = Color[B] * (Color [A] * Filter[A] * Transmit[A]) +
Color[A] * (1- Filter[A] - Transmit[A])

to

Color[result] = (1- Filter[A] - Transmit[A]) * Color[A] +
(Color [A] * Filter[A] * Transmit[A]) * Color[B]

I can then daisy-chain in a third color and get

Color[result] = (1- Filter[A] - Transmit[A]) * Color[A] +
(Color [A] * Filter[A] * Transmit[A]) *
( (1- Filter[B] - Transmit[B]) * Color[B] + (Color [B] * Filter[B] *
Transmit[B]) * Color [C] )

and then expanding to give

Color[result] = (1- Filter[A] - Transmit[A]) * Color[A] +

(Color [A] * Filter[A] * Transmit[A]) * (1- Filter[B] - Transmit[B]) * Color[B]
+

(Color [A] * Filter[A] * Transmit[A]) * (Color [B] * Filter[B] * Transmit[B]) *
Color[C]

So then I need to somehow come up with values to keep F+T < 1, and adjust the r,
g, and b values to levels that will compensate for the effects of F and T.

It's unclear to me what his distinction is between Cp and Cs - maybe that's part
of where things are going sideways.

And trying to juggle the values of rgbf&t to give Color[result] values close to
<1, 1, 1> gives me rgb values of > 1, so it's unclear to me at this point how to
calculate rgbft to give a desired final rgb color.

Even with a spreadsheet to rapidly give me feedback, it's pretty difficult.
```