[SOLVED] Strange grey line when scaling

Anything libgdx related goes here!

[SOLVED] Strange grey line when scaling

Postby Descartes » Mon Oct 12, 2015 9:00 pm

Hi

I draw an image ontop of another image and everything is fine until I scale it down.
When I scale it down, there seems to be a strange grey line around the top image.

I'm attaching two images here, one is scaled and one not scaled.

As you can see, both images should have the same color and should combine with each other.
However when I scale down the window (even just a little bit), they do not combine because that grey line appear.

I though it might have something to do with the TextureFilter, so I changed it from Linear to everything else, but it did not change anything.

Any idea ?
Attachments
scaled.png
scaled.png (18.59 KiB) Viewed 4418 times
not-scaled.png
not-scaled.png (986 Bytes) Viewed 4418 times
Last edited by Descartes on Tue Oct 13, 2015 9:09 am, edited 1 time in total.
Descartes
 
Posts: 60
Joined: Thu May 28, 2015 5:35 am

Re: Strange grey line when scaling

Postby Descartes » Mon Oct 12, 2015 9:01 pm

BTW, I refer to the grey line at the top of the arrow, not on the sides (the sides is due to opacity in the image itself, while at the top there is no opacity or empty pixels at all).

Thanks.
Descartes
 
Posts: 60
Joined: Thu May 28, 2015 5:35 am

Re: Strange grey line when scaling

Postby tuonos » Mon Oct 12, 2015 9:50 pm

are you using a TextureAtlas?
if so, pack images adding these settings:

settings.paddingX = 2;
settings.paddingY = 2;
settings.duplicatePadding = true;
tuonos
 
Posts: 7
Joined: Tue Jul 15, 2014 1:10 pm

Re: Strange grey line when scaling

Postby Descartes » Tue Oct 13, 2015 7:18 am

Hi

Yes I use TextureAtlas but I create the atlas using a software called TexturePacker.
Are you familiar with it ?

Could you explain what the issue might be so I can try fixing it from the TexturePacker or in some other way ?
Descartes
 
Posts: 60
Joined: Thu May 28, 2015 5:35 am

Re: Strange grey line when scaling

Postby Descartes » Tue Oct 13, 2015 7:40 am

I suspect that the problem is related to the scaling iteself, of the arrow image.

If I move the arrow to another location and scale down, that darker line also appear at the top.
Descartes
 
Posts: 60
Joined: Thu May 28, 2015 5:35 am

Re: Strange grey line when scaling

Postby andreas.loew » Tue Oct 13, 2015 8:07 am

I assume that when talking about TexturePacker you mean www.codeandweb.com/texturepacker

You should be able to solve this issue by setting Extrude to 1.
Get TexturePacker for libgdx
andreas.loew
 
Posts: 15
Joined: Tue Dec 28, 2010 7:57 am

Re: Strange grey line when scaling

Postby Descartes » Tue Oct 13, 2015 9:09 am

Solved !

Could you please provide a short explanation ?
Descartes
 
Posts: 60
Joined: Thu May 28, 2015 5:35 am

Re: [SOLVED] Strange grey line when scaling

Postby andreas.loew » Tue Oct 13, 2015 10:12 am

Sometimes OpenGL blends in neighbor pixels when painting a texture.

Extrude surrounds your sprites with pixels of the same color. So instead of getting a tint from a neighbor sprite or transparency it gets the same color.
Get TexturePacker for libgdx
andreas.loew
 
Posts: 15
Joined: Tue Dec 28, 2010 7:57 am


Return to Libgdx

Who is online

Users browsing this forum: MSN [Bot] and 1 guest