Sunday, May 18, 2008

Assignment 3

(1)
























I used the Chromaticity Diagram to determine the corresponding values (x,y,z=1-x-y) for the values of the wavelengths W=380, 420, 460,...,700.
(2)
P1(x1,y1) - coordinates of color 1
P2(x2,y2) - coordinates of color 2
P(x,y) - coordinates of a color C on the segment determined by the two points
c1-percentace of color 1 in C; c2 - percentage of color 2 in C
We know that: c1*(x1,y1) + c2*(x2,y2) = (x,y) therefore we obtain:
c1*x1 + c2*x2 = x
c1*y1 + c2*y2 = y
We know that between two colors there can't be a third one, so c2=1-c1 which gives us
c1*(x1-x2) = x-x2
c1*(y1-y2)=y-y2
We obtain the formula for finding the concentration of color 1 in color C: c1 = (x-x2)/(x1-x2) = (y-y2)/(y1-y2) and c2 = 1- c1.
Notes:
We know that (x1,y1) different from (x2,y2), therefore either x1 is different from x2 or y1 is different from y2, so we do have a valid formula in all cases.
In the double equality above, the last equality is equivalent with the fact that P lies on P1P2.
(3)
P1(x1,y1), P(x2,y2), P(x3,y3) - coordinates of the three given colors
P(x,y) point interior to the triangle P1P2P3
Similarly, c1*(x1,y1) + c2*(x2,y2) + c3*(x3,y3) = (x,y)
We obtain a linear system with three unknowns, c1, c2, c3:
c1*x1 + c2*x2 + c3*x3 = x
c1*y1 + c2*y2 +c3 *y3 = y
We can substitute c3 = 1-c1-c2 and obtain:
c1*(x1-x3) + c2*(x2-x3) =x-x3
c1*(y1-y3) +c2*(y2-y3) =y-y3
The discriminant of the system is delta = (x1-x3)(y2-y3)-(x2-x3)(y1-y3)
delta1=(x-x3)(y2-y3)-(x2-x3)(y-y3)
delta2=(x1-x3)(y-y3)-(x-x3)(y1-y3)
c1=delta1/delta and c2=delta2/delta
(used Cramer formulas)
(4)
In the RGB model R(red) corresponds to the x axis, G(green) to the y axis and B (blue) to the z axis. The normalized coordinates are in the following table. The CMY components are determined by the formula: (C,M,Y)=(1,1,1)-(R,G,B) which means each color will transform into its complement.Complement colors: b and W, R and C, G and M, Y and B. The gray border will remain gray.

From the table, the components are:
C=(1,0,1,1,1,0,0,0), M=(1,1,0,0,0,1,1,0) and Y=(1,1,1,1,0,0,0,0).




b)
The resulted components will be the complements of the first ones: white, Cyan, Blue, Magenta, Red, Yellow, Green, black (in this order). The gray border will remain gray.

(5)
Inverts color means it turns each color into its complement: R-C, B-Y, G-M, b-W. This would then be equivalent with converting from RGB to CMY, so the transformation is given by the four equations presented in class (6.2-2, 6.2-3, 6.2-4).
If we apply this transformations to CMY, we'' have to substitute R, G, B in the formulas with their complements: 1-C, 1-M, and 1-Y respectively. We obtain:
"teta"= cos^-1*{(1/2[(M-C)+(Y-C)]/sqrt[(M-C)^2+(Y-C)(Y-M)]}
H="teta" for Y<=M and 2*pi-"teta" for Y>M
S=(C+M+Y)/(C+M+Y-3)*(1-max(M,Y,C))
I=1-1/3*(C+Y+M)
(6)
a)
The saturation (S) and intensity (I) will remain the same as they are symetrical formulas in Red and Blue. The Hue (H) may change.
b) Swapping the Red and Blue channels in GIMP.

No comments: