[Solved] Alpha'd Tx's have green edges

I think this is a very simple problem, but I can't seem to figure it out.  I believe it has something to do with the image format upon loading.  I'm using PNG's with transparency, but when I load them with:

Texture texture = TextureManager.loadTexture(image, Texture.MM_LINEAR, Texture.FM_LINEAR, 1.0f, false);

They have green edges.  I assume this is because the min/max/filters average the edge pixels (or choose nearest), and they don't handle the alpha correctly.
Is there no way to have the filters accurately average alpha channels without introducing the green?

have you tried loading w/o compression?

Texture t = TextureManager.loadTexture(url, Texture.MM_LINEAR,
            Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);

Ok, so removing compression as stated above seems to be the ticket.  There's still a very minor hint of green, but it's so much better that I don't even notice it.

Thanks for the solution mud.

these are just guesses :slight_smile:

do you have set an AlphaState with blending enabled?.

And maybe check if your Texture size is a power of 2.

Do you have a screenshot? I never had issues with png transparency on the edges.

Yes, my texture is 512x512.

And I have applied AlphaState with blending (the transparency outside the edges works just fine).

Here’s a screenshot, showing the original-sized image cut from the PNG (top/left), a scaled version showing what it SHOULD look like (left), and a screen grab from the app showing the green edges (right):

I have the exact same problem.


I think I’m having the same problem. Here a pic:


The left picture is a screenshot taken while running my program and the right picture is how the knight is supposed to look. You can see that there’s a white edge around the knight during the running of the program.

I tried the w/o compression (by the way, what does that mean :slight_smile: ), but it didn’t work for my program.

Any suggestions?


P.S. Forgive me for my bad English :wink:

one thing u can try is to further cut into ur image file. try to remove the white edge part by modifying ur image.


I think I've found the cause of my problem. It was the mipmapping, it causes a white edge to appear around the texture. But I still don't know how to get rid of it! Any suggestions?!