Page 1 of 1
White edge around rotated object
Posted: Mon Jan 13, 2014 7:04 pm
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
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 9:25 pm
by Gorus
Please post the code you use to rotate the image.
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 10:10 pm
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.
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 10:17 pm
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?
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 10:47 pm
by Nixola
It does, in this case
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 10:52 pm
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
Re: White edge around rotated object
Posted: Mon Jan 13, 2014 11:29 pm
by feelixe
Thanks alot, i'll try it when i get home:)
Re: White edge around rotated object
Posted: Tue Jan 14, 2014 11:56 am
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?
Re: White edge around rotated object
Posted: Tue Jan 14, 2014 11:59 am
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.
Re: White edge around rotated object
Posted: Tue Jan 14, 2014 1:41 pm
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