Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS apps - why include both @2x and low-res images?

This has been bugging me for a while. I don't understand why one should include low-res images. If a 3GS, for example, can't find the low-res image, it just uses the @2x version anyway and displays it at it's native resolution. So why add to the filesize of your app by including all the half-res images?

like image 259
soleil Avatar asked May 14 '12 01:05

soleil


People also ask

What is 1x and 2x image?

Jonathan Grieve 1x and 2x are just ways of defining an image that has a certain amount of pixel resolution. A 2x image has a higher resolution but has twice the width and height of a 1x image.

Why is it necessary to create multiple images for an Android app?

We need different size images so that OS loads particular image size that is required at that time, Smaller images reduces memory usage. It leads better efficiency. If your app uses less memory, it also means more apps can occupy memory simultaneously, faster multitasking.


1 Answers

Halley had it right. The system does not automatically downsample @2x images to non-retina size, and it shouldn't. The 3Gs does not have enough memory to load retina images. It will likely choke your app and cause it to exit with an out of memory error.

The problem gets even worse with the iPad 1. The iPad 1 has very low memory relative to it's screen size, and if you tried to make it load retina sized images, it would choke and die very quickly.

To scale an image the system has to load it at full size and do a complex scaling operation each time it draws it. It's the worst of all possible worlds - slower, 4x as much memory, and the images don't look as good.

like image 51
Duncan C Avatar answered Oct 02 '22 13:10

Duncan C