Why is there such a difference between RGB to XYZ

2019-02-25 08:55发布

Recently I have been trying to understand code that converts between the RGB color space and the CIE-XYZ color space, but it seems like every different calculator I try gives me radically different results. For example, trying to convert (255, 100, 70) to XYZ yields the following result, even when explicitly using d50 for everything:

  • EasyRGB gives (46.903, 30.817, 9.270)
  • Wolfram Alpha gives (0.7493, 0.7245, 0.6308)
  • Bruce Lindbloom.com gives (0.493910, 0.317574, 0.070047)
  • Java gives (0.95880127, 0.99554443, 0.8227539)

I don't see how these could possibly give such different answers. Which one is correct (if any)? Is there some sort of parameter that I am missing that differs between these websites?

2条回答
Rolldiameter
2楼-- · 2019-02-25 09:49

If you go through this Calculator you will realize that there are lot of parameters that needs to be defined before converting those values to XYZ. So its not a direct calculation which will hold true in any given condition. There are lot of variables that you have to consider while doing so (Also knowing which variables will not affect your calculation).

The calculation will also depend on the application you are trying to develop. The approach for sensing the colour would be different from reproducing the same on screen.

Colour calculator

查看更多
趁早两清
3楼-- · 2019-02-25 09:57

Because there are different RGB spaces, not just one.

On this page there is the general formula:

http://brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html

but the general formula depends on some parameters e.g. matrix M, which is different for each individual RGB space.

查看更多
登录 后发表回答