Image Blurring..

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Krynn-San
Prole
Posts: 6
Joined: Tue Jun 20, 2023 6:49 am

Image Blurring..

Post 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
User avatar
UnixRoot
Party member
Posts: 100
Joined: Mon Nov 08, 2021 8:10 am

Re: Image Blurring..

Post 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.
Krynn-San
Prole
Posts: 6
Joined: Tue Jun 20, 2023 6:49 am

Re: Image Blurring..

Post 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
User avatar
UnixRoot
Party member
Posts: 100
Joined: Mon Nov 08, 2021 8:10 am

Re: Image Blurring..

Post 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.
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: Image Blurring..

Post by pgimeno »

Example code that showcases the problem would go a long way in helping us understand the problem, and giving better advice.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests