Yxy 到 RGB 转换
我正在尝试实现从 Yxy 颜色空间到 RGB 的转换方法。这是通过首先转换为 XYZ 然后再转换为 RGB 来完成的。我发现 Yxy 的“官方”矩阵 -> XYZ 是
3.2410 -1.5374 -0.4986 -0.9692 1.8760 0.0416 0.0556 -0.2040 1.0570
这也是 Matt Pharr 的《基于物理的渲染》一书中使用的。
另一方面,3D图形领域的许多人使用
2.5651-1.1665 -0.3986 -1.0217 1.9777 0.0439 0.0753 -0.2543 1.1892
现在,据我了解,如果x= 0.33333并且y=0.33333,Yxy给出灰色阴影。这确实是我通过第二个矩阵得到的结果。第一个创建红色 RGB 值。
第二个矩阵有效,但它来自哪里?我发现很多人在他们的示例代码中使用它,但没有人真正解释它是否有物理背景。
提前致谢
I am trying to implement a conversion method from Yxy color space to RGB. This is done by first converting to XYZ and than to RGB. I found out that the "official" matrix for Yxy -> XYZ is
3.2410 -1.5374 -0.4986 -0.9692 1.8760 0.0416 0.0556 -0.2040 1.0570
This is also the one used in Matt Pharr's book Physically Based Rendering.
On the other hand, many people in 3D graphics area use
2.5651-1.1665 -0.3986 -1.0217 1.9777 0.0439 0.0753 -0.2543 1.1892
Now, as far as I understand if x= 0.33333 and y=0.33333, Yxy gives a gray shade. This is indeed what I obtain with the second matrix. The first one creates a red RGB value.
The second matrix works but where does it come from? I find many people using it in their example codes but nobody really explains if it has a physical background.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 xyY 到 XYZ 的转换是非线性的,即它不能通过矩阵乘法来计算。
来自维基百科上的 CIE 1931 色彩空间:
您的两个矩阵似乎都适用于 XYZ到 RGB 转换。第一个由 sRGB 原色和白点给出。第二个原色非常接近 sRGB(绿色有
x = 0.29
、y = 0.60
)和x = 0.334
、y = 0.334 白点。
如果您想使用其他 RGB 原色和白点,可以在以下位置找到一个列表: http://brucelindbloom .com/index.html?Eqn_RGB_XYZ_Matrix.html
The conversion from xyY to XYZ is non-linear, i.e. it cannot be computed by a matrix multiplication.
From the Wikipedia on the CIE 1931 color space:
Both your matrices seem to be for the XYZ to RGB conversion. The first given by the sRGB primaries and white point. The second by primaries very close to sRGB (green has
x = 0.29
,y = 0.60
) and ax = 0.334
,y = 0.334
white point.If you wish to use other RGB primaries and white point, there is a list at: http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html