Are iPhone retina pixels of the same physical dimensions as iPad retina pixels? - iphone

I'm designing an app that creates graphics for retina displays. One of the benefits I want to offer to the users is that the graphics designed the iPad app would look exactly the same on the iPhone.
However, by eyeballing the results, it seems to me that the physical pixels of iPhone retina display are about 20% smaller smaller than the iPad's one. So the 57x57 pixel space displayed on iPhone and iPad retina displays side by side would appear to have different shape - iPad would be larger.
I'm interested if there is really a difference in the physical dimensions of retina display pixels, or if it is a bug in my code.

Retina display on iPhone 5:
1136x640-pixel resolution at 326 ppi
Ipad (retina):
2048x1536 resolution at 264 pixels per inch (ppi)
So as you can see the density is higher on the iPhone than the Ipad. From this I would say you are correct.

They are not the same. Those devices use different displays that have different pixels/inch.
iPhone Retina: 326 PPI
iPad Retina: 264 PPI
http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density#Apple

Related

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.

High resolution images and the retina display

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).

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.

Is there any difference between iPad 2x mode and iPhone4 Retina display (for developer)?

Graphics development for iPhone4 and old iPhones was changed in several ways:
The concept of point was introduced
to replace pixel.
Methods of UIImage will load high
resolution resource files with #2x
in the file name.
Scale factor was added to UIScreen,
UIView, UIImage, and CALayer
classes.
So if we handle CGImage carefully, it's not hard to support the high resolution Retina display of iPhone4.
I have several questions about non-native iPad app in iPad 2x mode:
Could all the changes from old
iPhone to iPhone4 (#2x resources
auto loading, point concept, scale
factor) be applied to iPad 2x mode.
The scale of app on iPad can be
changed. How can I handle it?
With The new iPad sporting Retina Display you will need another set of images for some items such launcher icon, launch images (splash screen).
For example:
The launcher icon for Retina Display on iPhone/iPod Touch is 114 x 114 but on The new iPad the same icon for Retina Display is 144 x 144.
Other example:
On an Universal App, for the launch images (splash screen) you'll need an image set for phones/music players:
Default.png (For old devices)
Default#2x.png (For phones/music player with retina display)
Another image set for Tablets:
Default-Portrait~ipad.png (For original iPad and iPad 2)
Default-Portrait#2x~ipad.png (For the new iPad with retina display)
Default-Landscape~ipad.png
Default-Landscape#2x~ipad.png
The "#2x~ipad" will work on the new iPad in the same way "#2x" worked for the phones and ipods, but will be relative to the old iPad image set.
Unfortunately, all of those content scale functions were added in 4.0, so I don't think there's any way to use the iOS4 stuff that you're asking for.
The iPad 2x mode is just a way to run iPhone-only apps on the iPad's larger screen. If you want to take advantage of iPad's larger screen, all you have to do is create a universal binary (i.e. one that contains views for both iPhone and iPad).
There is no way to get the iPad 2x mode to display your iPhone retina level content automatically—Apple do not support this... presumably as they want people to put effort into developing iPad-specific interfaces for their apps.

What resolutions should iOS graphics be?

What pixels per inch settings do iOS 4 graphics need to be to support the high resolution display? Should I just use the standard 72, or should I specifically make images that are 320x480#163ppi and 640x960#326ppi? Or, should I just make images those dimensions and not worry about the resolution (i.e. leave it at the default 72)?
I'm not concerned about the iPad, only iPhone 3/GS, iPhone 4 and iPod Touch users.
Note
I realize this isn't about code, per se, but it is related to programming in so much as this is necessary for me to finish my iOS application ;)
Icon and image sizes are documented at https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/
326 ppi as that is the resolution of the retina display. They will resize/resample automatically on lower resolution displays.
Here is some more guidance:
http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/