High resolution images and the retina display - iphone

Am a newbie to iOS App development and to design. I was wondering about these 2 questions:
can I create a high-resolution image & use it for all the devices (be it retina or non-retina)? (why should one create a low-resolution image intentionally for a non-retina device? why can't everything be simply high-resolution?) ... I hope it isn't a dumb question!
And what do we exactly mean by 'high-resolution' here? '1024pixels X 1024pixels' ? how high is 'high'' really for a retina display?
Any help please?

"High Resolution" means twice the pixels in each dimension on iOS (and OSX). So if you have an image that is 23x10 pixels on a non-retina display, the high resolution version of it must be 46x20 pixels in size.
If you name your high resolution images like this: lowResImageName#2x.png, the system will automatically choose the high res image on retina devices.
As others have said, you use special low-res images to maximize quality (because you can choose to leave fine details out of a low-res image, etc.) and minimize memory footprint (because the non-retina variants have had half the RAM of the retina versions so far).
It also helps to think in non-retina pixels, because one non-retina pixel equals one "display point", the unit in which iOS measures sizes.

iOS devices' resolution is as follows:
standard retina
iPhone, iPod Touch 320 x 480 640 x 960
iPad 768 x 1024 1536 x 2048
iPhone 5 - 640 x 1136
Why create a low-resolution image? Because it will automagically be used on non-retina devices, saving memory.

For some images that will work just fine, but for certain ones (if your image has some fine text for example), they will come out looking jagged or distorted when scaled down automatically. There may also be cases when you want something displayed differently(I've had occasional images with cool gradient effects that just don't look right on a low res device, so I've had to remove some detail in the low res image to make it look okay).
The other answer is also correct in that if you allow for both cases, low res devices will only load the low res images into memory, so the app will be using less memory. This is only an optimization for those cases, but it is still helpful since typically you can assume that the low res devices will have less memory to begin with since they are older.

Retina graphics, the high resolution graphics you are mentioning, should be double the point values for width and height. What I mean by that is, on all iPhone-sized devices, the size of the screen is 320 points by 480 points. On non-retina devices, translates to 320 pixels by 480 pixels. On retina devices, this translates into 640 pixels by 960 pixels. Everything is double in both the horizontal and vertical directions.
What this means, is you should have two versions of all your image assets. So if you have image that you want on the screen that is 44 points wide by 44 points tall, you should have two images ... Image.png which will be 44 pixels by 44 pixels, and Image#2x.png which will be 88 pixels by 88 pixels (for retina devices, this is what the #2x represents).
Why have two versions, and not just the high rez version? Because it takes processing power to 'compress' the larger version into a smaller version. It's much easier to just already have the lower resolution version, and you are saving valuable memory.

The first question was answered by H2CO3. You safe memory on old devices (think of iPhone 3G, many current Apps are terribly slow, yet well-coded apps still work fine)
What does high-resolution mean?
E.g. on a non-retina device you can show some example.png of 300x200 pixels using [UIImage imageNamed:"example.png"].
High-res would mean, you had an additional example#2x.png of 600x400 pixels, i.e. double size. Then you're app size is bigger, both devices have appropriate graphics but you save memory on the old device (Which would have to allocate 4 times the memory with no added improvement for the user, because it still has only a 300x200 pixel-display-space for a 600x400 pixel image).

Related

What are the differences in UX between an iPhone 5 and iPhone 6 Plus that are relevant to an app?

Previous iPhone upgrades were uncomplicated. A resolution increase just meant an improvement in quality but no change in size, while the iPhone 4S-5 transition was simple since the device only added less than an inch to the vertical dimension, without changing anything else (pixel density, horizontal resolution, etc)
But the 6 Plus seems a bit more complicated because there are two major changes:
Instead of the resolution being a simple multiple of the older one, the 6 Plus first appears to draw at 3x to an offscreen buffer, then scales this down to 1920x1080.
The PPI has changed by a non-integral amount (from 326 PPI on 5S to 401 PPI on the 6 Plus).
This is making it hard for me to understand the following:
How much more screen real-estate do I REALLY have on a 6-Plus, in physical terms, on the X and Y axis, as compared to an iPhone 5?
Will my buttons be smaller/larger on the 6-Plus? Because of the different ppi and the scaling?
The physical ratio of the screens is easily derived from the physical dimensions themselves! Since the aspect ratio has been maintained, the ratio of the diagonals (5.5/4 and 4.7/4) should easily give you the increase in horizontal and vertical dimensions the iPhone 6 and 6 Plus provide over the iPhone 5.
Thus, you have 37.5% more space in EACH DIMENSION (width and height) in the 6-Plus, and 17.5% more space in the iPhone 6, as compared to the iPhone 5. The area ratios (although less useful) are 89% and 38% respectively.
The button-size calculation is more involved. To make things easy, let's consider the render-size (in inches) of a 100-points button. Now:
a. On non-retina devices (iPhone 1 to 3GS), 100-points translate to 100-pixels. Because of 163 ppi, their physical size would be 0.6135 inches
b. On retina devices (iPhone 4 to iPhone 6), 100-points translate to 200-pixels (2x scaling). because of 326 ppi, their physical size would be: 0.6135 inches
(of course we know from experience that buttons are the same physical size as on non-retina devices)
c. On retina "HD" devices (iPhone 6-Plus). 100-points FIRST translate to 300-pixels (3x scaling). They are then scaled DOWN to ~0.87 of their original pixel size (i.e. the 2208x1242 pixel-buffer is scaled to 1920x1080). This means, 300-pixels are now drawn as ~261 pixels.
Because of 401 ppi, their physical size would be: 0.65 inches
So buttons on a 6 Plus are 6% larger physically, given the SAME point size. For most practical purposes, this is a negligible difference, and can be ignored. And on the upside the slightly larger buttons may even improve usability of your app.
Thus a button or UI-element of a specific point-size, should have ALMOST the same physical size on both an iPhone 5/6 versus an iPhone 6 Plus.
Comment: This indicates that all the roundabout scaling and ppi-changes were effectively for Apple to achieve both:
1. A higher ppi on a new higher-end class of devices
2. Keeping the logical-points to physical-inches translation as CLOSE to the original ratio as possible, so that buttons etc remain the same size on all devices.
So you dont need to be concerned about button sizes. Just account for the 37.5% additional space available to you on in each dimension on iPhone 6 Plus, and 17.5% in the iPhone 6, in your app and you should be good to go.

Iphone 5 game resolution

I have a developer working on a game for me for ios for iPhone 5. He stated the resolution we must use for the game is 320 x 568, but the iphone 5 has a resolution of 640 x 1136 and he stated that this is the resolution for the graphics and not the game leveling design. The game is a 2D maze game.
I am still learning, so any help would be greatly appreciated. Which resolution is the correct resolution? Why is it half of what apple states?
Thanks in advance
Here's the story. When Apple introduced the iPhone 4, it introduced the "Retina Display". That is, the iPhone 4 had a screen with twice as many pixels on it than the previous iPhones. So to compensate, Apple came up with the screen points system. It works like this:
-On non-retina devices, 1 point = 1 pixel
-On retina devices, 1 point = 2 pixels
-On any device, the programmer's coordinates are done in points.
-On any device, the art assets should be done using pixels
Example: I have a 200x200 pixel image used on retina devices. When I load the image into a view, the size of the view is 100x100 points.
In order to make sure your image is loaded properly, you have to use the #2x suffix. If you have a 200x200 pixel image "myImage.png", it will be loaded as 200x200 points and will be scaled up on retina devices. If instead you name the image "myImage#2x.png", instead it will interpret the image as 100x100 points, and will scaled down on non-retina devices. You can also have two versions of an image (Apple recommends 2 images although it isn't strictly necessary). If you have both 100x100 pixel "myImage.png" and 200x200 pixel "myImage#2x.png", it will interpret them as two versions of the same image, and will use the #2x one on retina devices and the other one on non-retina devices. In both cases, the image will be interpreted as 100x100 points.
You might also want to take a look at Apple's High Resolution Guide.

Use only retina images in cocos2d

I am using 2 images: image.png and image-hd.png and it works fine for retina and non-retina too.
But what I want to do now is to remove all non-retina images and leave only retina images. I heard that a non-retina device will scale the image down itself. I tried it but it didn't work :( How I do this? What name should I give to the image that it will show picture its actually size on retina and for non-retina will be scaled down?
No, Retina images are not scaled down automatically.
Only using Retina images and using them scaled down on standard resolution display devices is a bad idea.
Non-Retina devices have far less memory than Retina devices, but you're forcing them to load the Retina resolution images. In other words: device has half the memory, but is forced to load images that consume four times as much texture memory as need be.
Non-Retina devices have slower GPU & CPU. But you're forcing them to work on four times the number of pixels. Performance suffers.
You probably need to scale it down manually. I'm not sure if thats the best idea.
But I think you can just scale down the images to 0.5 if in retina device.
About images, its important to remember that each image is taking memory according to the size of the next power 2 dimensions. Which means that 20X20 pic will take the same memory as 32X32, and 130X260 will take 256X512.
So sometimes just handling your image sizes better or using something like Sprite Sheet.

Desiging Websites for Retina style devices: What dimensions should you use when designing?

The dimensions of the iPhone is 320x480
The dimensions of a Retina iPhone is 640x960
When designing a design for a retina device, do you set the size of your document to 320 x 480 or 640 x 960?
I would have thought you would have set the size to 320 x 480.
The reason for this is that although a retina device has more pixels, these are still being displayed on a 3" screen size. If you did set your size to 640 x 960, then when viewed on a retina display, all the text would be small, as although there are more pixels, the screen isn't physically bigger.
Is that correct?
UPDATED: Do you also use 320 x 480 as a base size for CSS (see comments below)
Yes, that's correct. I'm an iOS developer, not a web designer, but in iOS devices you specify everything in points (which is one pixel on a non-retina device, and a 2x2 pixel block on a retina device) so everything is the same size. The extra pixels on the retina display simply make everything look better.
You can get away with smaller text on a retina screen since you have more detail, but accessibility wise that's not a good move, since lots of people can't then see your text without zooming, whatever kind of display they have.

What resolution should my iPhone App Icon be?

What image resolution can/should be used for the icon.png file for an iPhone app? I know the size is 57 x 57 but what about the resolution?
Resolution only matters when you are trying to match the size of an image across multiple devices (print, screen, etc)
App icons are always 57x57 and will display without any scaling thus resolution doesn't matter (you could save it as 72dpi, 65535dpi or missing the dpi metadata entirely--SpringBoard won't care and will draw it the same in all three cases)
Here is the link to Apple guidelines, with the sizes for iPad, iPhone retina, etc:
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/AppIcons.html#//apple_ref/doc/uid/TP40006556-CH19-SW1
The "resolution" matters, but don't confuse "resolution" with dpi. Dpi is a measure used for printing, it means "dots per inch". It works like this: if you have an image of 100 x 100 saved at 100dpi, it will measure on paper exactly 1 inch (100 pixels per inch).
The dpi for the icons doesn't really matter, as they are intended for screen display only, not for printing.
It is customary to save images as 72dpi - the so called "screen resolution", because the old 14'' monitors (remember those?) could only display a maximum of 72 pixels per every inch of screen. This is no longer true, especially for the "retina" display of the iPhone. It has a much denser screen resolution, it can show much more pixels in a single inch than the older models of the iPhone. This is why you have to save 2 icons: one for retina display at 114 x 114 pixels, and another for the older iPhones, at 57 x 57. Again, the dpi doesn't matter, because whatever dpi you choose, the number of pixels on your image does not change: it would always have exactly 12,996 pixels (114 x 144).
I have had the best luck submitting to the App Store with 72dip, 57x57 icons.
I only want to say that the DPI (or resolution) is a value that only makes sense when an image is printed. The DPI acronym stands for Dots Per Inch, and it only tells the printer to draw that specific number of pixels by inch of paper. While working on screen devices, the DPI isn't important at all.
If creating new images for the iPhone work with the image size in pixels i.e. 57 x 57 for icons. If you work with image sizes set in millimetres or inches, you'll find that 10mm on your monitor equates to only 4.4mm on the iPhone. The iPhone resolution is 163ppi which is over twice (2.25) the 72dpi resolution of a normal monitor. There is another good reason for the question, in that you may need to provide larger images for marketing (websites, blogs, banner ads, or even printed material) requiring zoomed in images that remain super sharp. In these general wider use cases I prefer to work at 300 dpi at the largest target size and then resize/resample image and resolution when done.
57 x 57 and Apple takes care of the rest. Apple suggests that you have larger, more detailed graphics for, in the event, that your app gets selected as a feature app.
The iPhone 3GS and prior display is 163dpi, so if you intend to create icons that are of a particular size relative to how they are shown, that should give you enough information. Note that the icon must be 57x57 pixels to be shown at that dpi.
The iPhone 4 and later and the fourth generation iPod touch and later have 326 dpi displays, and the icon must be 114x114 dpi to be shown at that dpi.
57x57, as said.
You can chosse by code if let Apple to add the "shiny effect" or if you'll do (or not) it by yourself