Search code examples
htmlioscssretina-display

iOS retina image size limit?


I'm having an issue displaying my retina sprite sheet on iOS devices. It was displaying correctly original but now - since adding more images to the sprite - it no longer shows up on the front end.

I'm wondering if there is some sort of size limit to images that can be displayed on iOS? The sprite itself is very large in terms of pixels (thankfully not in terms of file size). 1780 x 6300.

I've search around and this blog says there is a size limit: http://dev.billysbilling.com/blog/The-retina-trifecta-CSS-sprites-IMG-tags-and-SVGs-oh-my

Is it true?


Solution

  • On very old iOS devices, the largest texture that can be created in OpenGL is 1024x1024. Newer devices support 2048x2048 and higher. It's unlikely that any devices support textures larger than 4096x4096. Try those 3 sizes and see which is the largest that work for the devices you're targeting. Non-square textures are limited to the same maximum width or height as a square texture.