Alex Rivera | Logout

What is the most memory-efficient way of downscaling images on iOS?

Asked 2012-11-06T12:39:15.987
23

In background thread, my application needs to read images from disk, downscale them to the size of screen (1024x768 or 2048x1536) and save them back to disk. Original images are mostly from the Camera Roll but some of them may have larger sizes (e.g. 3000x3000).

Later, in a different thread, these images will frequently get downscaled to different sizes around 500x500 and saved to the disk again.

This leads me to wonder: what is the most efficient way to do this in iOS, performance and memory-wise? I have used two different APIs:

Both worked for me but I'm wondering if they have any difference in performance and memory usage. And if there are better options, of course.

Edit
Report

1 Answer

7

While I can't definetly say it will help, I think it's worth trying to push the work to the GPU. You can either do that yourself by rendering a textured quad at a given size, or by using GPUImage and its resizing capabilities. While it has some texture size limitations on older devices, it should have much better performance than CPU based solution

answered 2012-11-11T16:11:27.840

Your Answer