Texture has weird "green" lines

Hello,
I want to render this texture:

When I render it using “GL_LINEAR” as the MAG_FILTER and GL_CLAMP as the GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, it looks like this:

There are little green and little gray lines near the edges of the texture.

Why does this happen?

Best regards,
Jan

The grey lines are probably due to not using pre-multiplied alpha. Using un-multiplied alpha with

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

in combination with linear filtering will produce that effect. The solution to that is to pre-multiply alpha, i.e. convert each texel from (r,g,b,a) to (a*r,a*g,a*b,a) and use

glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

Using pre-multiplied alpha gives the correct result when interpolating between opaque and transparent pixels.

As for the vertical green line: Is the entire image a single texture, or is it two copies of the texture, one mirrored? I.e. is the line in the middle of the texture or at the edge? If it’s the edge, try GL_CLAMP_TO_EDGE rather than GL_CLAMP.