Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For an iPhone only, iOS 7+ app, can we include only @3x images?

In an effort to reduce bundle size, is it possible (and a good idea) to only add @3x images?

To clarify, I'm not referring to the app icon, launch image, etc. But images that are internal to the app, like UIButton background images.

I saw Image resolution for new iPhone 6 and 6+, @3x support added?, but it didn't answer my question.

like image 810
abc123 Avatar asked Sep 29 '14 03:09

abc123


People also ask

What is 1x 2x and 3x in iOS?

1x, 2x, and 3x images allow developers and Apple to optimize app presentation based on the user's device, whether an entry-level iPhone or the most expensive iPad. Conceptually, 1x, 2x, and 3x images are the same image -- simply at different sizes.

What size are iOS app icons?

As for iOS, app icons should be sized at 1024×1024 pixels. Similar to Android, the icon will be resized depending on the device and context, but Apple takes care of that for you. If you want the specifics on those sizes for visual testing or experimenting, click here. iOS app icons must be saved as PNG files.

What is iPhone image size?

Your iPhone uses a ratio of 3:4 by default, which means that if you wanted to print a 3 x 4 photo or a 6 x 8 photo, you could do it without any cropping at all. Of course, neither of these is a standard print size, meaning you will likely have to crop your image to a standard photo print size.

How do I overlay images in iOS?

Tap Tools. Scroll down and tap Double Exposure. Tap the photo icon at the bottom of the screen to choose a photo to superimpose. Choose a second photo that will appear over top of the first.


2 Answers

Yes you can, but you shouldn't.

If you only add @3x images it will both reduce your bundle size and be compatible with all screen densities.

Update: As of iOS 9, Apple has introduced App Thinning which means that including more image sizes will no longer increase your bundle size. The App Store automatically generates a thin binary for each specific device and only includes the appropriate @3x or @2x image sizes.

I do not recommend only @3x if you need to support older devices. Embedding only @3x images will cause your images to be scaled down each time the app is run. This approach has the following downsides:

  • You have no control over the image scaling mode that iOS uses. Certain images may see significant pixelation and/or artifacts after being scaled automatically.
  • Scaling images can potentially slow app performance. This is especially true on older devices, which will be doing lots of scaling. Using only @3x images will increase the processing time of these scaling operations even more than scaling down from @2x.
  • You will have no opportunity for pixel perfect exporting of assets. Many designers take the time to manually scale their image assets to ensure that fine strokes and textures are not disrupted. This results in the best experience across all device types.

If you care about your apps looking clear and crisp on most devices, I would highly recommend that you at least export your images @2x and @3x screen densities. Depending on the compatibility needs of the project, I sometimes choose not to export @1x.

If you are only aiming for iPhones running iOS 7+, then you definitely do not need to export @1x. All @1x iPhone devices do not support iOS 7+. The only @1x devices that you will need to worry about are the iPad 2 and iPad mini (non-retina).

Another note: in researching your question I heard rumors that Apple may reject your apps for not having images at every density. I have never experienced this. The only thing that I could find in the developer guidelines was this rule.

2.10 iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution

To me this seems to imply that as long as it works, you are good. But c'mon man, make it beautiful!

like image 139
dfmuir Avatar answered Oct 05 '22 11:10

dfmuir


In my testing, I've found @3x isn't recognized on iOS 7 and below. So if you plan to support iOS 7 & 8, you'll definitely want to include @2x images.

As for the resolution of said images, I haven't found a satisfactory answer yet. For the app I'm working on, taking the example of a fullscreen jpg (likely a photo), I would save at 1242x2208 for @3x and 750x1334 for @2x to match the highest resolution those images will be displayed at on an iPhone. It's not a pixel perfect solution since the images will need to be scaled down on non-iPhone 6(+)'s but I think it's a good middle ground that doesn't involve too much extra work with if statements dictating which image based on the screen size (ugh) and 5 different images.

One thing to note about performance concerns dfmuir brings up is that these images are going to end up being scaled down in a lot of cases, 4/4S, 5/5S, 6/6+ in display zoom mode, even if you go with apple's preferred method of including 3 images at @1x, @2x, and @3x, since we now have 5 (or 6 including 3gs) different resolutions (See the rendered pixels row in this chart for more info: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions)

The only way you don't get these issues with photo-like images (so not considering UI elements), is if you design it such that your images are in relation to points (so staying the same size relative to say your thumb instead of relative to the phone's screen size), but that doesn't always make sense for the app's design. An example would be cropping on the lower resolution phones instead of being scaled down.

like image 42
Kyle Fleming Avatar answered Oct 05 '22 11:10

Kyle Fleming