Page 1 of 1

Image Blurring..

Posted: Mon Jul 03, 2023 7:03 pm
by Krynn-San
So I'm trying to recreate a game, and I'm using a sprite copied from the game, but on zoom in it's blurring around the edges, as if to smooth it..

The first line of my main.lua is love.graphics.setDefaultFilter("nearest", "nearest")

It seems to be blurring the image whether i just screenshot it from the original game (e.g. 60x30, each colored part is 4 pixels) or if i just use the pixel perfect image (e.g. 30x15), whether i scale it up to fit the original or not..

and this seems to apply to all the sprites in my game btw

Re: Image Blurring..

Posted: Mon Jul 03, 2023 7:14 pm
by UnixRoot
Do you mean blurring or edge bleeding? Edge bleeding can happen if you scale up textures that are part of a bigger texture atlas. You can use array textures or disable mip mapping, if you don't want edge bleeding.

Re: Image Blurring..

Posted: Mon Jul 03, 2023 9:55 pm
by Krynn-San
Ahh so to prevent this edge bleeding, what lines would I use? I tried enabling mipmaps on my images, and then using

myNewImage:setMipmapFilter("nearest", 1)

but nothing changed, although at -1 instead of 1 it was twice as blurry

Re: Image Blurring..

Posted: Tue Jul 04, 2023 7:42 am
by UnixRoot
I didn't mean the filter mode, but disabling mip mapping completely for the image. But I'm still not sure if you're talking about edge bleeding or blur. Is the whole image blurry or only the edges?

Please show the part of your original code where you set the filter mode and create the images. And a screenshot would be nice too.

Re: Image Blurring..

Posted: Tue Jul 04, 2023 2:14 pm
by pgimeno
Example code that showcases the problem would go a long way in helping us understand the problem, and giving better advice.