Pixel Art and anti-aliasing

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
delcore92
Prole
Posts: 5
Joined: Wed Jan 30, 2013 1:52 am

Pixel Art and anti-aliasing

Post by delcore92 »

Hello i have some pixel art that is 8x8 and i wish to have it scaled up. my problem is when the image is scaled the pixels are blurred. i want to achieve a nice crisp blocky look. If anyone could help me that would be great :awesome:
Attachments
spaceship.love
Problem Code
(2.99 KiB) Downloaded 162 times
User avatar
slime
Solid Snayke
Posts: 3159
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Pixel Art and anti-aliasing

Post by slime »

Check out (Image):setFilter or love.graphics.setDefaultImageFilter, using the "nearest" filter mode.
delcore92
Prole
Posts: 5
Joined: Wed Jan 30, 2013 1:52 am

Re: Pixel Art and anti-aliasing

Post by delcore92 »

Thank you! The problem is solved !

Here's the solution :

Code: Select all

function love.load()
    love.graphics.setDefaultImageFilter("nearest", "nearest")
    ship = love.graphics.newImage("images/spaceship.png")
end
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Pixel Art and anti-aliasing

Post by kikito »

Also consider using integer coordinates (with math.floor) when you draw the ship on the screen. If you use raw float values, you might get "pixel artifacts" - the pixels of the image will "change" while the ship moves.
When I write def I mean function.
Post Reply

Who is online

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