jpg or png for UIImage — which is more efficient?

后端 未结 7 1633
刺人心
刺人心 2021-02-06 04:35

I am grabbing an image from the camera roll and then using it for a while as well as save it to disk as a PNG on the iPhone. I am getting the odd crash, presumably due to out of

7条回答
  •  旧时难觅i
    2021-02-06 04:48

    1. is more memory then used by the UIImage after I reload it off of disk if I saved it as a PNG? => No, it's the same memory size if you import from 2 images that have same resolution and same number of channels. (such as RGBA)
    2. is it possible the act of saving as PNG uses up more memory transiently during the saving process? => No, it only effect your disk memory.

提交回复
热议问题