开发者

transparency implementation in YUV422 using only Y

开发者 https://www.devze.com 2023-03-19 12:31 出处:网络
Lets say we have 2 images in YUV422 format and assume that the second image Y field of value 0x10 is being transparent and merged on to the first one with Cb and Cr overwritten.

Lets say we have 2 images in YUV422 format and assume that the second image Y field of value 0x10 is being transparent and merged on to the first one with Cb and Cr overwritten.

The product of such merge results in ugly borders (divided pixel line efect) of soli开发者_开发问答d shapes. Is there a way to produce a combination of values on borders, so the transition is smooth?


This problem is not specific to YUV4:2:2:, but occurs whenever binary transparency is used. The best solution is to use a four-channel image and include an alpha channel. Essentially, an alpha channel represents the "degree of opaque-ness" of each pixel. When two images with alpha-channels overlap, alpha blending produces a result that looks much better.

If you're stuck with YUV4:2:2 or can't add alpha channel, you could try smooth the transition the two images with a low-pass filter. This will hurt the definition of your edges, but might look better than doing nothing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号