Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / About black edge around the images.

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 13th Mar 2012 11:27
Finally I found the reason that the images have black edge, because the images are 8 bit,not 32 bit.

The Miracrea Games
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 13th Mar 2012 12:38
all my images are 8bit. i don't have any black borders.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Mar 2012 10:27
What borders do you mean? I haven't noticed any apart from when you use scaling.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Mar 2012 10:51
You get borders on some images that are not power of two on some devices. You can fix it by changing the size of your images to 128, 256, 512, 1024 in size.

I don't see any reason why 8bit images would have a border. Do you have an example?

Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 17th Mar 2012 12:31
Baxslash, just so I understand, say my image is 112 x 27, when you say change your image to Power of 2, are you suggesting I change this to 128 x 32 and then just set the remaining area to transparent?
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 17th Mar 2012 12:55
yes
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 17th Mar 2012 13:00
Thanks MikeMax, got it!
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 17th Mar 2012 13:34 Edited at: 17th Mar 2012 13:36
Are we talking about edges around the whole image rectangle or the non-transparent parts?

I've never had the former - but usually use 2^ sizes, even if it means a little stretching.

I have had the latter - caused by antialiasing, which could explain the 8 bit thing.

For example, I edit images at much higher resolution and then use Irfanview to downscale them to the size used by the app.

This re-sampling process "softens" the image as the antialiasing compensates for the lower resolution, making the image look more detailed than it actually is.

However, if this is done with a black transparency, it introduces a soft edge which you don't see against black, but produces a visible outline if the image is over a lighter colour.

This would only explain "inner" outlines though.

Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th Mar 2012 17:37
Baxslash what devices are known to produce these artefacts if images are not ^ 2 ?

On windows and ios I never noticed any problems and most of my images are not ^ 2!
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Mar 2012 21:44
Any phone (as far as I know), or even netbook need ^2 images. You will only get non ^2 images working on PCs or macs with average/good video hardware. Otherwise they will be padded out to the nearest ^2. You will tend to notice problems when scrolling uv coords, or animating, more so than just plain one image sprites also ( you don't notice the extra blank space to the right of the sprite).
As I said above and Marl has mentioned, I have only seen edges around sprites when the filter is causing it. Normally using SetDefaultMagFilter and related commands will fix this.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th Mar 2012 18:39
Never noticed any problems with AppGameKit on iOS and non ^2 images
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Mar 2012 01:32
Try using a non power of 2 image and scrolling the uv left or right. You will get a gap at the end, unless the player has been fixed of course I got this with Froggit until I changed it.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 19th Mar 2012 15:25
i don't use UV scrolling!

now i know why i never came across all these black line/border problems!!!
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 20th Mar 2012 19:55
Could non-^2 images cause crashing on some mobile devices?

swis
Joined: Tue Dec 16th 2008
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Mar 2012 03:33
Only if they were very large, safe is 1024x1024 or below, anything higher varies by platform.

Login to post a reply

Server time is: 2024-11-23 05:11:20
Your offset time is: 2024-11-23 05:11:20