Retain sharpness in scaled images

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
HannesP
Prole
Posts: 3
Joined: Tue Dec 30, 2008 4:22 am
Location: Sweden

Retain sharpness in scaled images

Post by HannesP »

Is it possible to retain the sharpness of images when drawing them with a scale factor? Mine become "fuzzy" in the edges when I do so, and when one pixel neighbours a pixel with 0 alpha, unwanted white "outlines" occur. I just want simple n^2 scaling where 1 pixel is drawn as 4 at 2x, 9 at 3x, 16 at 4x etc.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Retain sharpness in scaled images

Post by rude »

Ah, first time I've seen anyone (other than me) complain about those evil borders. It's related to the color of the transparent pixels, which apparently are white in your case. I made a function to alleviate that ages ago. Too bad it mysteriously stopped working. :rofl:

Sorry, there's no nearest neighbor filtering (yet).
User avatar
HannesP
Prole
Posts: 3
Joined: Tue Dec 30, 2008 4:22 am
Location: Sweden

Re: Retain sharpness in scaled images

Post by HannesP »

Yay, at least it's a known issue :) how hard is this to implement in the backend? I know nothing about OpenGL programming, but my intuitive guess is that setting some kind of option in would be enough to make OpenGL render the images the way I want them. Am I completely wrong on this?
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Retain sharpness in scaled images

Post by rude »

You're not wrong. You're spot on. It's not hard at all.
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Retain sharpness in scaled images

Post by S-Rave »

Will this be fixed in 0.6.0? :monocle:
srejv
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Retain sharpness in scaled images

Post by osgeld »

I also would like to see this
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Retain sharpness in scaled images

Post by S-Rave »

There isn't an issue about this in the tracker. :o
srejv
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Retain sharpness in scaled images

Post by rude »

S-Rave wrote:Will this be fixed in 0.6.0?
That was the plan.

There is an issue in the tracker, it just has a really bad name.
Post Reply

Who is online

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