Maximum Image Sizes

I see the likely texture limit for most devices now is 2048 X 2048 at least.

I was hoping to use an image that is 10,000 X 300 but I take it Im not going to be able to do that? Its a long, long, long image.

What would you do with an image that size, out of curiosity? I believe texture limit is based on memory usage, so you don’t crash the system. So a limit of 2048 x 2048 tells you the device should be able to handle images with that resolution or less. Newer devices have a greater texture limit. Still curious what you would do with an image the size. 

It would be an image to side scroll.

So is the example 2048 pixel size the maxium image the device can handle at any one time, or the maximum one image can be? If the latter, could I have multiple 2048 pixel size images next to each other on the same screen at the same time, using a tool such as TexturePacker and Image Sheets to make it?

Hi @Betlic,

The “limit” depends on the device, and many modern devices let you go up to 4096x4096, and perhaps higher for the newest HD/Retina devices (I haven’t checked in specific however). As James suggests, you shouldn’t “need” an image around 10000 or higher, and actually that’s really bad because it increases the texture memory by 4x every time you step past the next “power-of-2” level. In other words, an image of 2048x2048 actually takes up four times the texture memory as an image which is 1024x1024.

This guide and the “Conserving Texture Memory” section should help you understand how the internal calculations occur:

http://docs.coronalabs.com/guide/basics/optimization/index.html#texturemem

Brent

And yes, the limit that a device has pertains to one image, not all images collectively. You can have as many as you want loaded into texture memory, but at some point, if you keep loading more and more into memory, you’ll eventually exceed the total texture memory limit and the app will slow down to a crawl and/or crash.

Brent

I would also do your own testing. If you are using Illustrator or Inkscape for svg, you should understand dpi settings and image resolution before exporting your svg files to bitmaps. It is very important for performance that you don’t have a 1024 x 1024 png file that you scale to 100 x 100 pixels in your app. Thats a waste. In my experience, images always look better if the size you need is the size you create. Of course if you are using different sizes of the same image for different screen resolutions thats fine.

Interesting! Thank you for all the replies.

What would you do with an image that size, out of curiosity? I believe texture limit is based on memory usage, so you don’t crash the system. So a limit of 2048 x 2048 tells you the device should be able to handle images with that resolution or less. Newer devices have a greater texture limit. Still curious what you would do with an image the size. 

It would be an image to side scroll.

So is the example 2048 pixel size the maxium image the device can handle at any one time, or the maximum one image can be? If the latter, could I have multiple 2048 pixel size images next to each other on the same screen at the same time, using a tool such as TexturePacker and Image Sheets to make it?

Hi @Betlic,

The “limit” depends on the device, and many modern devices let you go up to 4096x4096, and perhaps higher for the newest HD/Retina devices (I haven’t checked in specific however). As James suggests, you shouldn’t “need” an image around 10000 or higher, and actually that’s really bad because it increases the texture memory by 4x every time you step past the next “power-of-2” level. In other words, an image of 2048x2048 actually takes up four times the texture memory as an image which is 1024x1024.

This guide and the “Conserving Texture Memory” section should help you understand how the internal calculations occur:

http://docs.coronalabs.com/guide/basics/optimization/index.html#texturemem

Brent

And yes, the limit that a device has pertains to one image, not all images collectively. You can have as many as you want loaded into texture memory, but at some point, if you keep loading more and more into memory, you’ll eventually exceed the total texture memory limit and the app will slow down to a crawl and/or crash.

Brent

I would also do your own testing. If you are using Illustrator or Inkscape for svg, you should understand dpi settings and image resolution before exporting your svg files to bitmaps. It is very important for performance that you don’t have a 1024 x 1024 png file that you scale to 100 x 100 pixels in your app. Thats a waste. In my experience, images always look better if the size you need is the size you create. Of course if you are using different sizes of the same image for different screen resolutions thats fine.

Interesting! Thank you for all the replies.