top of page

Why do I get black outline around the stroke?

I ran into this when using my Playtime Painter Asset on transparent textures, and noticed the same effect in cases when graphics rendering is involved. Here is a quick solution and explanation:

In the picture in this article the upper part demonstrates what you see when Alpha is used as transparency, and the image bellow shows what is actually recorded into color channels. Before the red and green stroke were applied, the texture was "empty" black. On the left part I did a simple blit of 4 channels R,G,B and A, so red and green color were blitted to black. But on the right side, the transparent areas were treated as lacking any color information, and as a result black was replaced with the color I was painting with. That is why right side doesn't produce the weird black outline.

Photoshop/GIMP will always use the correct method, but in computer graphics we use shaders, and quite often we don't need object to be transparent, and use those alpha channel to store other information, usually glossiness of the surface. And during editing the texture, the software can't know which shader we will be using it with.

In my asset I added a "Transparent Layer" toggle which by default will be equal to "Alpha is Transparency" import setting of your texture. So if Alpha is indeed equal to transparency, set it to true.

bottom of page