i´m having trouble converting RGB to XYZ.
Accordying to this http://easyrgb.com/index.php?X=MATH&H=02#text2 The formula is:
var_R = ( R/255 )
var_G = ( G/255 )
var_B = ( B/255 )
if ( var_R > 0.04045 ) var_R = ( ( var_R + 0.055 ) / 1.055 ) ^ 2.4
else var_R = var_R / 12.92
if ( var_G > 0.04045 ) var_G = ( ( var_G + 0.055 ) / 1.055 ) ^ 2.4
else var_G = var_G / 12.92
if ( var_B > 0.04045 ) var_B = ( ( var_B + 0.055 ) / 1.055 ) ^ 2.4
else var_B = var_B / 12.92
var_R = var_R * 100
var_G = var_G * 100
var_B = var_B * 100
X = var_R * 0.4124 + var_G * 0.3576 + var_B * 0.1805
Y = var_R * 0.2126 + var_G * 0.7152 + var_B * 0.0722
Z = var_R * 0.0193 + var_G * 0.1192 + var_B * 0.9505
The problem is that if i use Red = 7, Green = 7, Blue = 80, the values are wrong. XYZ from the same site computes it as
X = 1.612
Y = 0.776
z = 7.654
But, using the same formula described, the result i´m finding is:
X = 0,60174915012
Y = 0,3723904480
z = 2,3369759394
The values above are the same ones as if i use excel to compute. so, i´m not understanding what i´m doing wrong. If i use the formula provided from the site the values are the ones above, but calculating from their site, the results are different ?
How to properly compute the values of RGBtoXYZ so it can result on the same values as their calculator ? (assuming their calculator are giving the correct values, of course)
Note: Stackoverflow is saying that this is a duplicated question about pow. But it have nothing to do with pow, but a error on the formula above