1

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 solid shapes. Is there a way to produce a combination of values on borders, so the transition is smooth?

Ulterior
  • 2,786
  • 3
  • 30
  • 58

1 Answers1

2

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.

Michael Koval
  • 8,207
  • 5
  • 42
  • 53
  • The merge happens after I can do anything with it. First image is changing independently in a background, so smoothing would help if it was static, but not in this case.. – Ulterior Jul 09 '11 at 18:31
  • Do you know (or programmatically determine) the border of the two images? – Michael Koval Jul 09 '11 at 18:43
  • The images are of the the same size, I am not sure how borders could be related here. If it would be of any help - the principal described here is called On Screen Display. – Ulterior Jul 09 '11 at 20:46
  • Can you post an screenshot of the problem? – Michael Koval Jul 09 '11 at 21:31