I`m working on some web application where I want to convert CIE 1931 color space code to RGB or HEX code. How can I convert it?
1条回答 默认 最新
- duanhao4909 2014-02-05 20:49关注
Well, to get to RGB from XYZ you can use this matrix:
[ R ] [ 3.240479 -1.537150 -0.498535 ] [ X ] [ G ] = [ -0.969256 1.875992 0.041556 ] * [ Y ] [ B ] [ 0.055648 -0.204043 1.057311 ] [ Z ]
But since you have xyY (at least, I assume) values, you'll first need to convert them to XYZ values, like so:
X = (x*Y)/y Y = Y Z = ((1-x-y)*Y)/y
So in theory, you could calculate it like so:
R = 3.240479*((x*Y)/y) + -1.537150*Y + -0.498535*(((1-x-y)*Y)/y) G = -0.969256*((x*Y)/y) + 1.875992*Y + 0.041556*(((1-x-y)*Y)/y) B = 0.055648*((x*Y)/y) + -0.204043*Y + 1.057311*(((1-x-y)*Y)/y)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥100 set_link_state
- ¥15 虚幻5 UE美术毛发渲染
- ¥15 CVRP 图论 物流运输优化
- ¥15 Tableau online 嵌入ppt失败
- ¥100 支付宝网页转账系统不识别账号
- ¥15 基于单片机的靶位控制系统
- ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
- ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
- ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
- ¥15 手机接入宽带网线,如何释放宽带全部速度