POV-Ray : Newsgroups : povray.advanced-users : Reconstructing full color pigment pattern : Re: Reconstructing full color pigment pattern Server Time 2 Mar 2024 22:27:44 EST (-0500)
 Re: Reconstructing full color pigment pattern
 From: Bald Eagle Date: 16 Jul 2019 14:50:01 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.5d2e1bdc8425f2c54eec112d0%40news.povray.org",
"headline": "Re: Reconstructing full color pigment pattern",
"dateCreated": "2019-07-16T18:50:01+00:00",
"datePublished": "2019-07-16T18:50:01+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
So, I read a lot of posts about RGBA, and alpha compositing, etc, and I also
remembered that clipka weighed in with:

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.
```