跳至主要內容

Alpha 阿尔法透明度原理

LincZero小于 1 分钟有道云

Alpha 阿尔法透明度原理

一些实验结果(左底右上)

(255,255,255,100%) + 1*(0,0,255,50%) = (255,255,255,100%) + (0,0,255,50%) = (127,127,255,100%)
(255,255,255,100%) + 2*(0,0,255,50%) = (255,255,255,100%) + (0,0,255,75%) = (63,63,255,100%) 
(255,255,255,100%) + 3*(0,0,255,50%) = (255,255,255,100%) + (0,0,255,87.5%) = (31,31,255,100%)

结论(小写为/255的,A为下,B为上)

A(R1,G1,B1,a1) + B(R2,G2,B2,a2)
= C(
    R2*a2 + R1*a1*(1-a2),   # 不能简单的R2*a2+R1*a1,一来混合后颜色光变少,颜色变暗;二来符合了交换律,不能进行遮挡
    G2*a2 + G1*a1*(1-a2),
    B2*a2 + B1*a1*(1-a2),
    1-(1-a1)*(1-a2)         # 同滤色算法
)

一些补充

PS取色无法取得到Alpha,选色面板里也没有Alpha一值,只能够通过画笔设置来调整Alpha和流量