White edge around rotated object

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
feelixe
Prole
Posts: 36
Joined: Tue Aug 20, 2013 10:29 am

White edge around rotated object

Post by feelixe »

When i rotated an image there a very thin white edge around it. Clamp wrap should be on be default so i don't really understand.
Here's a screenshot of how it looks ingame: http://gyazo.com/275b7da19b8d736d49f52d9281df514f
Anyone got a clue? Thank you
User avatar
Gorus
Prole
Posts: 9
Joined: Sat Jan 11, 2014 8:33 pm

Re: White edge around rotated object

Post by Gorus »

Please post the code you use to rotate the image.
User avatar
DaedalusYoung
Party member
Posts: 413
Joined: Sun Jul 14, 2013 8:04 pm

Re: White edge around rotated object

Post by DaedalusYoung »

This is caused by the underlying colour of the transparent areas of your image. Try filling the background with black, and alpha at 0, or even the colours of the neighbouring pixels with alpha at 0, in your favourite image editor.
User avatar
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: White edge around rotated object

Post by nuno »

DaedalusYoung wrote:This is caused by the underlying colour of the transparent areas of your image. Try filling the background with black, and alpha at 0, or even the colours of the neighbouring pixels with alpha at 0, in your favourite image editor.
if alpha is 0, does it matter if the color is black or white?
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: White edge around rotated object

Post by Nixola »

It does, in this case
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: White edge around rotated object

Post by slime »

nuno wrote:if alpha is 0, does it matter if the color is black or white?
It does if he's using linear filtering and isn't using premultiplied alpha plus the premultiplied blend mode.

Some technical info:
http://blogs.msdn.com/b/shawnhar/archiv ... alpha.aspx
https://developer.nvidia.com/content/al ... or-not-pre
feelixe
Prole
Posts: 36
Joined: Tue Aug 20, 2013 10:29 am

Re: White edge around rotated object

Post by feelixe »

Thanks alot, i'll try it when i get home:)
feelixe
Prole
Posts: 36
Joined: Tue Aug 20, 2013 10:29 am

Re: White edge around rotated object

Post by feelixe »

I tried it now and it didn't work :/ I probably did something wrong, i opened the .png and made a second layer and filled it with black and set transparancy to 0. Maybe photoshop does something?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: White edge around rotated object

Post by micha »

In most drawing programs you can set the background color. Somewhere in the document settings. It is important that you set the background color to transparent black, instead of having a layer that is fully transparent. At least from what I know.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: White edge around rotated object

Post by Germanunkol »

As the others said, the background colour is the issue. Here's a tutorial for how to change that in gimp:
http://love2d.org/forums/viewtopic.php? ... mp#p131621
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Post Reply

Who is online

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