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

前端 未结 6 2073
后悔当初
后悔当初 2021-01-31 19:18

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

6条回答
  •  抹茶落季
    2021-01-31 19:32

    I think if you want to save the memory you can read the source image from tile to tile and compress the tile and save to the destination tile.

    There is an example from apple. It is the implementation of the way.

    https://developer.apple.com/library/ios/samplecode/LargeImageDownsizing/Introduction/Intro.html

    You can download this project and run it. It is MRC so you can use it very smoothly.

    May it help. :)

提交回复
热议问题