help white images on HTC 1X

Monkey Targets Forums/Android/help white images on HTC 1X

silentshark(Posted 2012) [#1]
Hiya,

I really need some help!

Just spotted an issue with our up and coming game on an HTC1X (ICS 4.04). All is fine on the Bluestacks emulator, on a samsung galaxy s2, on a sony experia S and even a samsung galaxy Y.

On the 1X, many of the graphics don't render - they just appear as white. Specifically, it seems to be a number of the bigger images which aren't appearing. The following PNG's seem to be the ones which aren't appearing..

2x 2400x480 background images
1x 4096x33 image (used for tiles in the game)
1x 4000x24 image

Any pointers? Do I need to make the image sizes powers of 2? Are there other limits I am breaking (e.g. are the 2400x480's just too big?).

Any help would be much appreciated!


Amon(Posted 2012) [#2]
I'm not sure of this but I think there is a limit to what size of image can be loaded on the HTC One X. I have the same phone and I only had this problem with images close to or the same size as you have.

To correct the issue I broke the image up in to 4 smaller pieces. I'm pretty certain that your images are too large to be supported by the phone so maybe try to reduce them in size or break them up in to smaller pieces.


silentshark(Posted 2012) [#3]
cheers Amon, is shrinking the images by a factor of two, then scaling up at runtime a help on these big images?

It'd be great to know what "sensible" limits for images look like, i.e. limits which mean that your program will run on "most" phones/ tablets!


Midimaster(Posted 2012) [#4]
I guess, you need this large images for scrolling background purposes?

Why do you not devide them in 6 strips and paint 2 small ones instead of one big? (I used this for endless background: Images 6 fits on its right side to the left side of image 1. so I had a endless background)

one 2400pix image
[monkeycode]DrawImage BackGround,-ScrollX,0[/monkeycode]

better performance:
2400:6=400pix images
[monkeycode]For local i%=0 to 7
If ( -ScrollX + (i+1)*400 )> 0
If ( -ScrollX + i*400 )< DeviceWidth()
DrawImage BackGroundPart[i],-ScrollX+i*400,0
Endif
Endif
Next[/monkeycode]

The 4000x24 image I would sort in 10 rows so it becomes 400x240pix

[monkeycode]Function DrawTile(Number%,X%,Y%)
Local Row%=Int(Number/10)
Local Column%=Number Mod 10
DrawImageRect AllTilesImage,X,Y,Column*24,Row*24,24,24
End
[/monkeycode]


silentshark(Posted 2012) [#5]
Thanks for your advice, Midimaster..

You are right, the large images are for scrolling backgrounds. I like your idea of splitting images into smaller ones. For now, though, I have simply shrunk the images down, then I scale them up at runtime. For the record, my "problem" images are now reduced to:

2x 1200x240 (was 2400x480) background images
1x 2048x33 (was 4096x33) image (used for tiles in the game - now using fewer tiles
1x 2000x12 (was 4000x24) image

..and now work fine on the HTC 1X.

I'd still love to hear views on "sensible" maximum sizes for images for Android.


Xaron(Posted 2012) [#6]
I try to stay below 2048x2048 which should run on almost all devices. 4096x4096 is already quite heavy especially for some older devices.


Gerry Quinn(Posted 2012) [#7]
You've probably found the 'sensible' size, given that nearly everything could handle larger, and you've fixed the device that gave problems. Looks like 2048 is the dividing line.


silentshark(Posted 2012) [#8]
Yeah, my new rule of thumb is to keep image dimensions under 2048.. Cheers


Nobuyuki(Posted 2012) [#9]
I recommend going even smaller, and setting your internal limit at 1024x1024 as higher texture sizes than that can still choke older devices (and maybe even some recent ones on the extreme low-end). For example, the G1, the Nexus One, and even the iPhone 3g only have a max texture size of 1024.

For reference: Most of today's phones have a max texture size of 2048x2048, but some high-end phones and and high density display devices will have a 4096x4096 size limit. Here's a graph I stole from someone else (who mined GLBenchmark for the data):

Apple iPad 3			4096
Apple iPad 2			2048 / 4096
Apple iPad			2048
Apple iPhone 4S			4096
Apple iPhone 3G S		2048
Apple iPhone 3G			1024
Google Galaxy Nexus		2048
Google Nexus One		1024 / 2048 / 4096
Google Nexus S			2048
HTC One S			4096
LG P880				2048
Motorola Xoom			2048
Samsung Galaxy Tab		2048
Samsung Omnia2			2048
Samsung OmniaHD			2048
SonyEricsson Xperia Arc		4096
SonyEricsson Xperia Play	4096
SonyEricsson Xperia S		4096
T-Mobile G1			1024



silentshark(Posted 2012) [#10]
That's useful. Many thanks