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
Related
I have a multiplatform iOS/Android game that I programmed in Cocos2d-x. I have only one set of images to use (I'm only after high res devices) that get scaled according to the device's resolution. For example all images are for the iPad but if you are using a Galaxy S then the image locations and scaling are affected by GalaxyS_screenWidth/iPadscreenWidth.
This works fine for all Android devices and on iPad, iPad2 and old iPhones, but with Retina iPhone there is a problem. On the iPhone 4 all my images look extremely pixelated, a result from the images being scaled to iPhone non-retina resolution then scaled back up to fill the screen.
I tried enabling Retina Mode and the images are half of their intended size (maybe due to the usage of get winsize() which uses points) and scaling manually causes other sorts of problems. I tried playing with a lot of options and attributes but to no avail, so what should I do now?
EDIT:
This is not only a graphics issue, as text gets automatically scaled down then up and appears pixelated.
EDIT 2:
Fonts are bitmaps so my bad. But I don't want to use retina as all images are already retina by default. All of my images are set up for the iPad so for iPhone 4 I just scale them down a bit. This works with Android phones.
For example I have an image, depending on screen resolution obtained through getwinsize():
If current resolution width is 1024 then image stays the same.
If current resolution width is 900 then image gets scaled by 900/1024, no problem.
If device is iPhone 4 resolution width is 480, so image gets scaled by 480/1024, then cocos2d-x automatically scales the resulting image by 2 thus the pixelation. I tried using getwinsizeinpixels, I tried multiplying the screen size, I tried many things but nothing worked out of the box unless I am to redo many of my code.
So the question is, how can I just let the damn engine treat the iPhone 4 as an Android phone with resolution of 960x640?
If you want Retina resolution images to look like Retina resolution images, then those images need to be in Retina resolution (960x480).
If you first scale down the image to 480x320 and then upscale it on the device, it will of course look blurred. You can't magically make the Retina pixels appear from a lower resolution image by scaling it up.
SI couldn't get to the bottom of it so I employed a hack. I enabled Retina Display then I scaled everything x2 through code except for the text. Sounds stupid, but it worked, and pixelation is gone. Thanks everyone who spent time trying to help me.
I tried enabling Retina Mode and the images are half of their intended size
when you enable retina support, cocos2d gets images by appending #"-hd" to their provided filenames. Such images are meant to be double the "visual" size (in iOS terms, pixels vs. points), so that they can be sort of scaled down to make full use of device resolution.
If you have a look at the CCDirectorIOS class, you will find there a couple of methods dealing with this, especially those dealing with the scalingFactor. I don't know what kind of changes you should do to make it work, but if you step into those methods and look at the value of various objects, you might find a way to modify cocos2D default behavior for your specific case.
If this seems to complicated, one thing you could try is changing the CC_RETINA_DISPLAY_FILENAME_SUFFIX so that cocos2d will not look for specially-named files for the retina iPhone, but just use the normal ones.
For example all images are for the iPad but if you are using a Galaxy S then the image locations and scaling are affected by GalaxyS_screenWidth/iPadscreenWidth.
Another thing you might try is not using winSize, but winSizeInPixels, so that when you scale down, you down do it down to the point resolution, but just to the pixel resolution (which is double the point resolution).
Hope this helps.
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).
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.
I have the following problem. My application has a tab bar at the bottom and a simple TextView above. In order to fit well TextView above tab bar I had to resize it (I did it through Interface Builder) - I just set height to 401px (usually I hate to do such things).
Then I have tested application on the simulator, to my surprise everything looked o.k. on both standard iPhone display and Retina display. Since I do not have an iPhone I am wondering if everything would look good on the real device as well.
So, my question is: how to set the UIView size so it follows best practices and, what is more important, GUI looks good on both Retina and older display.
BTW: I know how to deal with icons and graphics to make them look good on Retina and older display, I've read all the relevant stackoverflow posts on the subject :)
Size is same on both standard and retina display. It's measured in points. Number of pixels depends on display density.
Pixel != point.
Look at UIScreen scale property. For standard screen it contains 1.0 and 2.0 for retina (iPhone 4). It can contain different values, even not integers.
If you set size UIImageView size to 100x100, it will have same physical size on standard and retina display. But on retina, it will show you much nicer image, because 100 points contains more pixels.
The units in Interface Builder are now interpreted as points not pixels. Therefore it will look the same on both types of displays. On old displays 1 point equates to 1 pixel. On Retina displays 1 point equates to 2 pixels.
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/