# Alpha Bleeding explained

**URL:** <https://forum.castle-engine.io/t/alpha-bleeding-explained/479>\
**Category:** News\
**Created:** [December 26, 2021, 6:05pm UTC](https://forum.castle-engine.io/t/alpha-bleeding-explained/479 "2021-12-26T18:05:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [December 26, 2021, 6:05pm UTC](https://forum.castle-engine.io/t/alpha-bleeding-explained/479/1 "2021-12-26T18:05:03Z")

</div>

| [![Alpha bleeding investigation](https://castle-engine.io/wp/wp-content/uploads/2021/12/alpha_bleeding_5_gimp-200x138.png)](https://castle-engine.io/wp/wp-content/uploads/2021/12/alpha_bleeding_5_gimp.png "Alpha bleeding investigation") |

[Blending](https://github.com/castle-engine/castle-engine/wiki/Blending) is a common technique to achieve partial-transparency of various things (UI, 2D and 3D models). In many cases it means that your texture has an additional channel, _alpha channel_, that determines how much each pixel is opaque.

But there is a trap — colors from fully transparent pixels (that you, by default, don’t see in usual 2D image viewers and editors) can still affect the final rendering output, because when rendering we do _filtering_ that can average RGB colors from neighboring pixels. The way to fix these problems is _alpha bleeding_, which means that your transparent pixels also need some sensible RGB values.

I have written now a [proper manual page about the “alpha bleeding”](https://castle-engine.io/manual_alpha_bleeding.php), what problem does it solve and how to actually use it.

Our [castle-view-image](https://castle-engine.io/castle-view-image.php), that is already bundled with CGE binary release, contains a ready menu item to do it.

Note that the issue is not specific to _Castle Game Engine_. It’s an effect of how the GPU is using alpha and averaging RGBA pixels, and it really affects all game engines that exist. But some engines hide it better than us right now 🙂 E.g. Unity does _alpha bleeding_ for you automatically, during texture import, if you select _Alpha is Transparency_. In CGE, we do not (yet) have so trivial UI to do this.

_Please support the engine development on [our Patreon](https://www.patreon.com/castleengine). It funds development of the engine, it means we have resources to add engine features that make it easier to use and we have time to document them properly!_
