写了个软件用来计算RGB与YUV互转公式, 输入色彩空间,输出两者互转公式,原理是根据r177协议
后续我会把代码开源出来
"BT2020 625 D65"
Input:
r=(0.708,0.292)
g=(0.170,0.797)
b=(0.131,0.046)
w=(0.3127,0.3290)
RGB2XYZ Matrix:
0.6370, 0.1446, 0.1689
0.2627, 0.6780, 0.0593
0.0000, 0.0281, 1.0610
XYZ2RGB Matrix:
1.7167, -0.3557, -0.2534
-0.6667, 1.6165, 0.0158
0.0176, -0.0428, 0.9421
RGB2YUV Matrix:
0.2627, 0.6780, 0.0593
-0.1396, -0.3604, 0.5000
0.5000, -0.4598, -0.0402
YUV2RGB Matrix:
1, 0, 1.4746
1, -0.1646, -0.5714
1, 1.8814, 0
"BT601 625 D65"
Input:
r=(0.64,0.33)
g=(0.29,0.60)
b=(0.15,0.06)
w=(0.3127,0.3290)
RGB2XYZ Matrix:
0.4306, 0.3415, 0.1784
0.2220, 0.7067, 0.0713
0.0202, 0.1296, 0.9393
XYZ2RGB Matrix:
3.0634, -1.3934, -0.4758
-0.9692, 1.8760, 0.0416
0.0679, -0.2288, 1.0691
RGB2YUV Matrix:
0.2220, 0.7067, 0.0713
-0.1195, -0.3805, 0.5000
0.5000, -0.4542, -0.0458
YUV2RGB Matrix:
1, 0, 1.5560
1, -0.1875, -0.4888
1, 1.8573, 0
"BT601 525 D65"
Input:
r=(0.63,0.34)
g=(0.31,0.595)
b=(0.155,0.070)
w=(0.3127,0.3290)
RGB2XYZ Matrix:
0.3935, 0.3653, 0.1917
0.2124, 0.7011, 0.0866
0.0187, 0.1119, 0.9584
XYZ2RGB Matrix:
3.5060, -1.7398, -0.5441
-1.0690, 1.9778, 0.0352
0.0563, -0.1970, 1.0500
RGB2YUV Matrix:
0.2124, 0.7011, 0.0866
-0.1163, -0.3837, 0.5000
0.5000, -0.4450, -0.0550
YUV2RGB Matrix:
1, 0, 1.5752
1, -0.2256, -0.4772
1, 1.8269, 0
"BT709 sRGB D65"
Input:
r=(0.64,0.33)
g=(0.30,0.60)
b=(0.15,0.06)
w=(0.3127,0.3290)
RGB2XYZ Matrix:
0.4124, 0.3576, 0.1805
0.2126, 0.7152, 0.0722
0.0193, 0.1192, 0.9505
XYZ2RGB Matrix:
3.2410, -1.5374, -0.4986
-0.9692, 1.8760, 0.0416
0.0556, -0.2040, 1.0570
RGB2YUV Matrix:
0.2126, 0.7152, 0.0722
-0.1146, -0.3854, 0.5000
0.5000, -0.4542, -0.0458
YUV2RGB Matrix:
1, 0, 1.5747
1, -0.1873, -0.4682
1, 1.8556, 0
"NTSC C"
Input:
r=(0.6700,0.3300)
g=(0.2100,0.7100)
b=(0.1400,0.0800)
w=(0.31006,0.31616)
RGB2XYZ Matrix:
0.6069, 0.1735, 0.2003
0.2989, 0.5866, 0.1145
-0.0000, 0.0661, 1.1162
XYZ2RGB Matrix:
1.9101, -0.5325, -0.2882
-0.9846, 1.9991, -0.0283
0.0583, -0.1184, 0.8976
RGB2YUV Matrix:
0.2989, 0.5866, 0.1145
-0.1688, -0.3312, 0.5000
0.5000, -0.4184, -0.0816
YUV2RGB Matrix:
1, 0, 1.4022
1, -0.3456, -0.7145
1, 1.7710, 0
网友评论