Image transparency algorithm

xiaoxiao2021-03-06  68

Note: This algorithm is collected online, and non-original first, it is possible to obtain the RGB three-base color of the upper layer and the lower color, and then R, G, B is the color value of the last acquired; R1, G1, B1 is the color value of the upper layer; R2, G2, B2 is the lower color value r = R1 / 2 R2 / 2; g = G1 / 2 G2 / 2; B = B1 / 2 B2 / 2; the above is 50% transparent. To use different transparens with the following algorithm (alpha = transparency): (50% or less) R = R1 - R1 / Alpha R2 / Alpha; g = g1 - g1 / alpha g2 / alpha; b = B1 - B1 / Alpha b2 / alpha; (50%) R = R1 / Alpha R2 - R2 / Alpha; g = g1 / alpha g2 - g2 / alpha; b = b1 / alpha b2 - b2 / alpha;

The following is a picture effect picture made from 50%

转载请注明原文地址:https://www.9cbs.com/read-91303.html

New Post(0)