Removing blur on scaled sprites

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
User avatar
mitterdoo
Prole
Posts: 2
Joined: Sun Dec 27, 2015 11:03 am

Removing blur on scaled sprites

Post by mitterdoo »

I've been trying to make a 16-bit styled game with small sprites, but when I try to scale them, I just get a heavily blurred image instead.
Image
Is there any way to get rid of this effect?
Attachments
BadBlur.love
(647 Bytes) Downloaded 86 times
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Removing blur on scaled sprites

Post by veethree »

Image:setFilter("nearest", "nearest")

You could also use love.graphics.setDefaultFilter() before loading the images so you don't have to set the filter for each.

Code: Select all

image = love.graphics.newImage("Image.png")
image:setFilter("nearest", "nearest")
or

Code: Select all

love.graphics.setDefaultFilter("nearest", "nearest")

image = love.graphics.newImage("Image.png")
image2 = love.graphics.newImage("Image2.png")
User avatar
mitterdoo
Prole
Posts: 2
Joined: Sun Dec 27, 2015 11:03 am

Re: Removing blur on scaled sprites

Post by mitterdoo »

veethree wrote:Image:setFilter("nearest", "nearest")

You could also use love.graphics.setDefaultFilter() before loading the images so you don't have to set the filter for each.

Code: Select all

image = love.graphics.newImage("Image.png")
image:setFilter("nearest", "nearest")
or

Code: Select all

love.graphics.setDefaultFilter("nearest", "nearest")

image = love.graphics.newImage("Image.png")
image2 = love.graphics.newImage("Image2.png")
Ah. Thanks man.
Post Reply

Who is online

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