Homework 2 - Spectra


The transformation from XYZ to RGB is based on the chromaticity coordinates supplied by Brian:

R G B W
x .625 .28 .155 .283
y .34 .595 .07 .298

from which the following transformation can be obtained:

[ R ] [ 3.4834 -1.5218 -0.5592 ] [ X ]
[ G ] = [ -1.0715 1.9659 0.0367 ] [ Y ]
[ B ] [ 0.0635 -0.2002 0.8107 ] [ Z ]

I've tried the following gamut mapping techniques resulting in the images below:


The first approach is to clip the RGB values to [0,255]^3 which results in pretty strong mach bands. However, this phenomenon is influenced by how we set the clip level. By combining clipping with scaling (thus increasing the clip level) we can reduce the mach band effect.

Click here to see a movie about this.


The problem with scaling is that we loose energy at the mixed colors. To avoid it we can use desaturation and some gamma correction by x^(1/gamma) to put more emphasis to those colors.
It is an interesting question, how we should determine the scaling factor. We can set a fixed level for all the channels (from outside or 255/(the average of the maximum values), or set different factors for each channel (for example setting it to the half of the maximum value).

Movie on the effect of gamma correction ( 1<=gamma<=2 ).


As a sideeffect of our desaturation method we get more points mapped to the range of mixed colors (see figure above). That's why we get the pink, purple and green areas. Also, there's another mach band effect at the primary colors due to the density differences after mapping (the transition from pure to mixed colors is not smooth enough).


Instead of scaling a tempting approach would be to use a nonlinear mapping function in RGB space. This image was generated with the atan mapping described above (t=0.15). The problem here is that though we blur the mach bands, everything is shifted towards white.

Movie ( 0<=t<=0.5 ).


Here we desaturate completely and scale down to 255 with gamma correction 1.3. This way we don't have to do clipping at all, but too much energy is lost (due to scaling).


To preserve energy we can do "partial" desaturation with some scaling and clip the rest. Although this seems to yield the best results, we still have those ugly mach bands and the mixed colors are not emphasized enough.

The outcome also depends on the location of the white point. Click here to see a movie of moving the white point from blue towards green.


Conclusions

No wonder that none of the techniques work alone. I think that the desaturation mapping could be modified so that it generates a more uniform distribution on the RGB triangle (which would take care of the mach bands at the primary colors). This transformation should avoid generating pink at the right side. Also, the intensity changes should be made more evenly distributed, which is complicated considering the number of factors effecting it.


ikits@cs.utah.edu