[LIBGDX] Tilesets: Create padding

Right now my tilesets have no padding. Padding around the tile to avoid bleeding I mean.

Now I would like to have paddings, although I would have to rewrite my level editor and tile system to not just split a tileset by the tile sizes but account for paddings.

Using libgdx, I am aware that the gdx texture packer can do this automatically. However this has 2 problems: first I would need to cut my tileset into individual tiles first and then repack it, and atm I am not aware how to save a big tilesheet to many tile pngs, although I did it in the past v_v
Second problem is: the texture packer seemingly orders the tiles on the sheet arbitrarily randomly. Which usually makes sense, you dont care, it just packs according to size where it makes sense.
However in this case I need to mimic my tilesheet so that all the tiles are at the correct location… otherwise its a lot of work redoing the levels with the correct tiles… AND whenever you would remove or add a tile, you wouldnt be sure if that doesnt mess up the whole order

So I dunno best case would be if I can create padding myself.
Does anyone already have an opensource algorithm for create those tile paddings ?

I dont really understand, why do you need this padding? If you use Textures which are a widht and height of power of 2 and you use GL_NEAREST as filter, you should not get any bleeding textures.

Because its a tileset not individual images. you dont want to bind all the time

as discussed many times on this forum this creates bleeding (when scaling and then using imprecise camera positions)

actually I mitigated this problem a little bit by using some UV hacking: http://www.java-gaming.org/topics/libgdx-texture-array-because-of-bleeding/33272/msg/312224/view.html
But of course thats not ideal and also when using shaders it fucks up and does bleeding again

This is me testing a blur shader, since I wanna do some motion blur

I am doing this with my shader:


vec4 texColor = vec4(0.0); // texture2D(u_texture, v_texCoords)
    texColor += texture2D(u_texture, v_texCoords - 4.0*blurSize) * 0.05;
    texColor += texture2D(u_texture, v_texCoords - 3.0*blurSize) * 0.09;
    texColor += texture2D(u_texture, v_texCoords - 2.0*blurSize) * 0.12;
    texColor += texture2D(u_texture, v_texCoords - blurSize) * 0.15;
    texColor += texture2D(u_texture, v_texCoords) * 0.16;
    texColor += texture2D(u_texture, v_texCoords + blurSize) * 0.15;
    texColor += texture2D(u_texture, v_texCoords + 2.0*blurSize) * 0.12;
    texColor += texture2D(u_texture, v_texCoords + 3.0*blurSize) * 0.09;
    texColor += texture2D(u_texture, v_texCoords + 4.0*blurSize) * 0.05;


Obviously creates bleeding when you dont have padding. ALthough I wonder how much padding would be enough in this case
guess it really depends on the blursize here