Your HTML5 game and it's web page may perform well on a desktop browser, but unfortunately this is no guarantee that it will perform well when viewed on iOS. This is because iOS imposes a a number of resource limits which you should keep in mind when designing your game and it's accompanying browser pages if you want the game to be played using this OS.
Next, because of the limited memory available on iOS, there are limits on the number of resources it can process, so you should try to stay within these restrictions:
- The maximum size for decoded GIF, PNG, and TIFF images is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM. That is, ensure that
width * height ≤ 3 * 1024 * 1024for devices with less than 256 MB RAM.
Note that the decoded size is far larger than the encoded size of an image.
- The maximum decoded image size for JPEG is 32 megapixels using subsampling. JPEG images can be up to 32 megapixels due to subsampling, which allows JPEG images to decode to a size that has one sixteenth the number of pixels. JPEG images larger than 2 megapixels are subsampled—that is, decoded to a reduced size. JPEG subsampling allows the user to view images from the latest digital cameras.
- The maximum size for a canvas element is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM. The height and width of a canvas object is 150 x 300 pixels if not specified.
- The maximum number of documents that can be open at once is eight on iPhone and nine on iPad.