How to animate large images in iOS

I am looking for a solution for animating about 50 images on the retina of the iPad, each 2048 * 1536 in size. I want to animate them when I move my finger (change the images to synchronize uiimageview with touching a moved event). Images load slowly and the animation freezes. I want to find a solution to solve this problem. Thanks.

0
source share
1 answer

There are several problems that are difficult to deal with in this situation. Firstly, the memory usage of 50 full-screen images is very large. For more information on how much memory is required, see this blog post Using video and memory on iOS devices . The second problem you are facing is CPU usage. There are several processors in the iPad's retina, but decoding huge PNG images still takes a lot of CPU cycles, which will prevent the animations from running smoothly. Thus, the only way you can work this out well is not to decrypt the image data at runtime, and also to avoid storing all the decoded data in memory, as this will cause the device to crash. The best solution is simply mmap () all decoded data and decode it ahead of time, which allows you to split image data in CoreGraphics, without having to copy the data. If you want to use my library that does all this, this is connected at the bottom of the blog post.

0
source

All Articles