James Bigler: CS6650 Homework 3
Using this function L(x,y,lambda) = (y/yres) delta(lambda - (420
* (x/xres) + 380)) plotted over the domain of x:[0,512],
y:[0,512]. The next question is what is lambda and how do we get RGB
from these values.
Using the formulas for the CIE Tristimus values (X,Y,Z) we can
eliminate lambda for the tilda functions.
X = 683 integral from lambda0 to lambda1 of (x-tilda(lambda)
* L(lambda) d(lambda)
Y = 683 integral from lambda0 to lambda1 of (y-tilda(lambda)
* L(lambda) d(lambda)
Z = 683 integral from lambda0 to lambda1 of (z-tilda(lambda)
* L(lambda) d(lambda)
We can substitute our L above and using the dirac-delta identity
(integral of x0 to x1 (f(x)delta(x-a)) = f(a) when x0 < x < x1, 0
otherwise) we get:
X = 683y/yres * x-tilda (420x/xres + 380)
We look
up the values of the tilta functions, and we can get X,Y,Z. We can
use a simple matrix transfer to get RGB
The problem with the image now is that RGB range from [-473.816,
-159.435, -144.455] to [1374.53, 1084.51, 1446.64]. Below is a list of
methods of getting these values between 0 and 1, while trying to
preseve most of the qualities of the function
Just Clamping
| This isn't the right solution, as the colors are to vivid. |
 |
Scaling
| This picks too much of the residue color around and looks washed
out. |
 |
Clamp minimum to 0
| Got this idea from Shaun
Ramsey's page on this. It's nice, but it lacks some of the
yellow, cyan, and magenta that comes from the overlap of the red,
green and blue. |
 |
Maximum of 1 - Scale
| Note we can see some traces of yellow, cyan, and magenta.
However there is a lot of noise(white stuff) around. We will have
to get these color from something else. |
 |
Min 0 - Gamma 2 - Scale
| Whoa! Let's scale back on the gamma. |
 |
Min 0 - Gamma 2 - Scale
| This is more like it! I think I'll take it. |
 |
Others
Max of 200 Scaled |
 |
Min of 0 Max of 500 Gamma 1.2 Scale |
 |
Min of 0 Gamma 1.5 Scale |
 |
Min of 0 Ln(x) Min of 0 Scale |
 |
Min of 0 Scale Sqrt(x) |
 |
Min of 0 Sqrt(x) |
 |
Min of 0 Sqrt(x) Scale |
 |
| Ln(x) |
 |
Ln(x) Min of 0 Scale |
 |
Ln(x) Ln(x)
|
 |
Ln(x) Ln(x) Ln(x)
|
 |
Scale Sqrt
|
 |
// this is sample code