TextureFilter issue

Hello :grinning:,

I am currently making a pixel art game

To optimize the space of my spritesheet, I reduced my images by 50%.

So, in my game, I scale images x2
:scale(2,2)

For pixel art, I put TextureFilter at nearest

display.setDefault( "magTextureFilter", "nearest" )
display.setDefault( "minTextureFilter", "nearest" )

But with nearest, I have irregular pixels issues in all resolutions.

exemple with a sprite scaling 25px and a sprite 50px no scale :

What’s wrong ? :weary:
Thanks,

Hi,
I don’t think you need that scaling… Just leave your images as they are do not make them smaller only for space. It will not safe you much of space.
I mean for me its easier to keep original image size, so there is less issues.

You are running into Solar2D’s dynamic scaling.

If your content area was 960x640 and your device resolution was also 960x640, then that scaling should work as is, but most likely the aspect ratio isn’t a perfect 1:1, which then leads to minor adjustments that lead to those artefacts.

To account for them, you’d need to change your scaling method or offset the size of the images so that they’d be the same pixel size on all screens regardless of the device resolution.

Thanks to both of you.

@XeduR now I understand. And yes, it can’t work.

I will follow the recommendations of @ConveyedRex7592 I will keep linear and original image size.

also,@Xedur I looked at your website and it’s really nice. :+1:

Oh, and I don’t know much about vector images, but you could use them.
You can scale them and you will not lose quality.
And I think they will use less space.
There are ways to convert raster images to vector(svg).

More about vector and other image formats:

If you would use svg there is a plugin for that:

Ok @ConveyedRex7592 i’ll keep that in mind :blush: