Libgdx: Problems with scaling

Hi,

I made a game with the resolution 960px x 960px. Everythings works fine, but when I try the web or the android version, there are some unsightly strokes as you can see here


.
I use one image sheet for all images. My pixel size for a tile is 24x24 and after 24 pixel the next sprite is in the image.
The problem: You can see, sometimes one pixel of the next or previous sprite is shown. In my opinion it is a problem with the scaling because the html version and the android version has to be scaled to fit to the screen.

Now my question … what can I do? One sprite = one image? But then I have MANY images …

The problem is likely nearest neighbor filtering sometimes taking false/wrong neighbor texels from another tile when sampling, because the corners/edges of your tiles use texture coordinates at the very corners/edges of the respective texture tile texels within the texture atlas. The solution is to offset and scale your texture coordinates, such that at the corners/edges of your tile, you do not use e.g. (0,0) or (1,1) as texture coordinates - which would be situated at the corners/edges of the texture - but use texture coordinates that lie exactly at the center of a texel.
The following image should visualize this:

The black raster should denote your texels. So at the center we have four texels. The red square should denote your tile and the texture coordinates it was given for its corners. (for this example, just suppose that the texture coordinates are from (0,0) to (1,1) for a single tile).
So, the whole thing is a tile mapped to a 2x2 texels texture part within the texture atlas.
The green part is the texture part of the tile we’re interested in.
The blue arrows then tell, that for the pixel at this very location (on the red edge), the nearest neighbor could be to the left of that edge sometimes, or to the right of that edge.
The smaller green square is the correctly down-scaled texture coordinates. This should still apply to the outer red/black square, but uses texture coordinates that map to the respective centers of the texels, so that no nearest neighbor filtering will ever choose a false neighbor outside of the tile’s texture space within the texture atlas.

Thanks for your reply.

Now every image in the imagesheet is 26px x 26px and repeats the last pixels and everythings looks good.
Like I said big thank you.

Now the game looks better in html and at android devices.