# Libgdx texture bleeding in tile map

So I am making a game in Libgdx using an isometric tiled map but when I set the texture filtering of the tiles to linear, black lines show up between all the tiles. This is caused because each tile blends with the tiles next to it.

I know many people have asked this before and the common answer seems to be add padding. I have padding but that doesn't help because then the tiles start blending with the clear pixels instead. That just turns the lines a different color.

Another option people say is to copy the pixels on the edge of each tile for padding, but unfortunately that only works for non-isometric maps. However when I use the tilemap preprocessor it works fine even with filtering, but the tilemap preprocessor causes many other issues so I don't want to do that.

How can I fix this? Somehow the tiledmap preprocessor does it fine but I'm not sure what that actually does other than adding padding. Any help is greatly appreciated!

• It is pretty easy to see what tiledmap does inside your IDE (at least in intellij idea). You can see the source code. – dimitris93 Aug 12 '15 at 9:44
• When you add padding, are you including the padding when you are rendering your sprite? Make sure that you don't. Another fix you can do, is not use a spritesheet, as the blending would be ignored on a fixed size image. – jgallant Aug 12 '15 at 11:31
• I know I can look at the source code but I mean I'm not sure what the tilemap preprocessor does. Also I am not including the padding when rendering, but I want to use a spritesheet because it is faster and easier. – Vincent Williams Aug 12 '15 at 14:49
• I still havent solved this. If i dont use a spritesheet for my tiles there are still lines but they are white instead of black. Does anyone know how to solve this? – Vincent Williams Nov 4 '15 at 15:11
• One thing I've used to help with some of the weirdness between tiles is to make sure the camera position is always locked to integer values. It seems to help clear up this issues for me in past projects. – LAMonday Nov 30 '17 at 15:25

You should check that your spritesheet is power of two.

For example:

3 tiles of 64x64 = one spritesheet of 192x64 ---> wrong

4 tiles of 64x64 = one spritesheet of 256x64 ---> right

Even if each sprite is power of two itself.

I hope this helps you.

• How does a power of two help? – Genhis Jun 27 at 21:09

If you're getting transparent edge pixels, it sounds like you haven't enabled duplicatePadding. Just to be sure, these are my recommended TexturePackerSettings:

duplicatePadding = true