I have the same problem (at least I think so) as 1 thread on this forum, but still after reading it I couldn't solve the problem.
This is the texture viewed in lets say Paint Shop Pro:

And this is the same texture but viewed in my application:

As you see there's a mayor difference.
My loading code:
package game;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import org.lwjgl.devil.IL;
import org.lwjgl.devil.ILU;
import org.lwjgl.opengl.GL11;
public class TextureLoader
{
public static int load(String path)
{
int pixelFormat = 0;
IntBuffer image = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
IL.ilGenImages(image);
IL.ilBindImage(image.get(0));
IL.ilLoadImage(path);
IL.ilConvertImage(IL.ilGetInteger(IL.IL_IMAGE_FORMAT), IL.IL_BYTE);
ByteBuffer scratch = ByteBuffer.allocateDirect(IL.ilGetInteger(IL.IL_IMAGE_WIDTH) * IL.ilGetInteger(IL.IL_IMAGE_HEIGHT) * 4);
IL.ilCopyPixels(0, 0, 0, IL.ilGetInteger(IL.IL_IMAGE_WIDTH), IL.ilGetInteger(IL.IL_IMAGE_HEIGHT), 1, IL.ilGetInteger(IL.IL_IMAGE_FORMAT), IL.IL_BYTE, scratch);
IntBuffer buf = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(buf);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, buf.get(0));
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
if(IL.ilGetInteger(IL.IL_IMAGE_FORMAT) == IL.IL_RGB)
pixelFormat = GL11.GL_RGB;
else if(IL.ilGetInteger(IL.IL_IMAGE_FORMAT) == IL.IL_RGBA)
pixelFormat = GL11.GL_RGBA;
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, pixelFormat, IL.ilGetInteger(IL.IL_IMAGE_WIDTH),
IL.ilGetInteger(IL.IL_IMAGE_HEIGHT), 0, pixelFormat, GL11.GL_UNSIGNED_BYTE, scratch);
return buf.get(0);
}
}
Any solution?
Thanks in advance!