I will be saving an image retrieved from the user’s library, let’s say the image is 300 x 300 after the image is cropped. Will I need to save a retina and non-retina image to the documents directly (i.e. 150 x 150 and (300 x 300)?
It seems like that would be unnecessary since there iPhone’s display is either retina or non-retina. Would it be more efficient to check for a retina display, and only save the larger image if it exists (if possible)?
I just want to make sure I am not overlooking something with my solution.
Just because they have a non-retina device now doesn’t mean they always will. They will upgrade one day and probably bring your app data along with them.
Also, for users with more than one device you should be syncing these images between all of them (using iCloud).
Since all pretty much all devices currently for sale are retina, I would only save the retina image. Don’t bother with a non-retina version and let the image drawing API’s handle resizing for you.
Have a play with various resizing/anti-aliasing algorithms. Some are faster than others and resizing to exactly half width/height is a special case where the low quality/fast resize algorithm can look as good or even better than the high quality/slow ones.
If drawing retina images on non-retina hardware causes performance or memory issues (usually it won’t) then you can resize the image to a smaller size and keep the small one in RAM. Resizing is way faster than reading from flash memory so this will not slow things down much.