Making an app Retina Display friendly - iphone

I have an app and would like to make it retina display friendly.
How exactly does the process work? What images need to be added apart from what I have?
I know the sizes should be different, but am not sure on the details?
What else needs to be done to handle retina display?
Should the device be detected and use other images if the device supports retina display?
What if there are a lot of images? And how will this effect the app size?
Thanks

A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with #2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called image#2x.png at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.

good articles if you're using sprites
http://weedygarden.net/2012/04/hi-res-retina-display-css-sprites/

The main thing about working with retina image is that image name convention.
And the size of image should be 2times greater than regular1.
Example- if your icon name for regular is icon.png then it should be icon#2x.png for
retina.And second thing is size for regular is 72*72 then it should be 144*144 for Retina.
It might be helpful for you.
Thnks

Related

Images for Retina-Display-iPhone Versus Normal iPhone

I would like to have images for my UIButtons, screen background etc in my iPhone app.
Will it work for both Retina display and normal display if I have
ButtonImage.png and ButtonImage#2x.png
Background.png and Background#2x.png
OR, should I do any extra coding so that it works for both displays?
ButtonImage.png is looking awkward on Retina Simulator. So, I should have a higher resolution image. So... please help me.
Chandu
UIImage's imageNamed: method automatically looks up the #2x images on the retina device if they're available; no additional coding is required.
If you’re putting the image in your user interface in a .xib file, or if you use the +imageNamed: class method for UIImage, then the #2x suffix is sufficient to load Retina images.
you have nothing to do, ios do the job to choose the right one
Short Answer: Yes, that is the right way to do what you want. UIImage will figure it all out for you.
However, don't forget that you can't just copy and rename a given image (say, Background.png). You need to get an image that is the same as Background.png, but four times the resolution (that's the same as double the width and double the height). Then, you can name that Background#2x.png and everything'll be peachy keen.
Here you have to use the simple image and it will work for both, Normal display as well as retina display. You just specify simple images with ButtonImage.png & Background.png in the resource bundle and retina images ButtonImage#2x.png Background#2x.png in the resource bundle.
Now you just need to specify the simple images in the code and retina image will automatically taken when running on the device with retina screen resolution i.e. iPhone 4 and later.
backgroundImageView.image = [UIImage imageNamed:#"Background.png"];
The same code will work and when iPhone 4 with retina display it will consider the image Background#2x.png from resource bundle automatically.
Let me know if you have any other question.
That's the right thing i mean whatever you are using or describing the way,but second thing
you need to do is that allocating the position for buttons.
If you will allocating position as a constant or fix by declaring x,y coordinate then it might not work,so try to allocate position of button in dynamic way so that it will take position once retina will call it.
Thanks

Images for Retina display

If i want my application to be compatible with the Retina display, am i obliged to recreate all my images by doubling their sizes? even the icon?
if you will not use high resolution images your images will look pixelated/blurr.So better to use high res images as well.Some Key points are:
Displaying graphics depending on the device model can be done by duplicating image files and adding an ‘#2x’ suffix. So, when the normal image file is named ‘button.png’, the hi-res version should be ‘button#2x.png’.
You don’t need any additional code for this. In Interface Builder or your code, assign the normal version (without the suffix) to an object. The same goes for the application icon. The resolution of the 2x icon should be 114 by 114 pixels. You will need to add a separate ‘Icon’ property in the Info.plist file for this icon.
If for some reason you do want to perform a check in your code, you can do so by checking the scale factor of the display. Older models will return a scale factor of 1.0, while the iPhone 4 will return 2.0. You can check this with:
float factor = [UIScreen mainScreen].scale;
Depending on the type of application you’re developing further optimizations can be made to utilize the new retina display the best you can.
A very good information here
hope it help you :)
You're not obligated, it just will look very pixelated if you don't.
As for the icon, I believe you are obligated to provide multiple sizes when submitting to the AppStore.
Maybe you'll want to take a look at iRetiner.
You could also check this previous stackoverflow thread : how to set image for ipad application that support retina display
A summary of the icons and what is required can be found in the human interface guidelines. I highly recommend providing high resolution artwork for the retina display even though it is not required. Your default now should be to design artwork at the higher resolution, then scale down for older devices. I doubt Apple would choose to highlight an application as new and noteworthy if it looks pixelated on the latest devices.

Convert iPhone app to universal binary (part II)

I have adjusted my target to be universal. Now the images look scaled up. Do I have to have every image twice, in different resolutions?
What's the correct way to do this? Or do I make images in iPad resolution and use them on the Phone as well?
And: if I do have to duplicate every image, is there a convention such as having the img.png for the iPhone in the Resources folder and the img.png for the Pad in the Resources-iPad folder?
Many thanks for your help!!
No I just suggest having them in one resolution (iPad) and they will scale down.
Actually I suggest making all graphics Retina compatible and then they will look fine on the iPad.
The best, and well the correct way to do this is to have 3 of every image
320x480 Default.png for iPhone
640x960 Default#2x.png for iPhone 4
and for iPad 768x1024 iPad Default Image sizes
But if your trying to keep your app as small in size as possible then making the images in retina resolution would be the best way to achieve this. The difference on iPad if scaled correctly wouldn't be noticed. Just be sure not to title the retina images with the "#2x" suffix and scale to fill on low resolution for low resolution iPone interfaces.

What size images should I use in order to support the two iphone resolutions?

I have a few questions about screen resolution, that I'm not clear on. These questions assume they my app will be running on iOS 4.0 and up, and on either iPhone 3GS or iPhone 4.
Should the size of the splash image (default.png) be (960x640) or (480x320)?
Should the size of the app icon (Icon.png) be (57x57) or (114x114)?
What about other graphics that I may use in my app, such a graphic that represents a button? Should I always create these images for the higher resolution, and have the app scale them down? In other words, if I want a button image to be displayed on the 3GS that is 200x40 - should I create the image at 400x80, so that iPhone 4 can take advantage of it?
Thanks!
A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with #2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called image#2x.png at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.
Provide both sizes (960x640 & 480x320) for the splash image using the #2x method described above
Provide both icons (57x57 & 114x114) using the #2x method
For our apps we use a combination of the #2x images and just Scaling the large images. (More information on this can be found in the above article) We use the #2x images for bar buttons, icons, etc. But for UIImageViews we often just use the Scaling. There can be a performance hit for doing this, but for most apps I'd say this is negligible. The savings in file size sometimes make scaling the only option.
Related Questions:
Retina/non-retina images in UIImageView
Making an app Retina Display friendly
You need to provide both if you want them to look nice. For example,
Default.png -> (480x320)
Amd
Default#2x.png -> (960x640)

When I create an iphone window based app, how to tell interface builder create window for retina pixel size?

I hope to create an iphone window based app for retina screen?
But I found that the size of window in mainwindow.xib is fixed.
How to adjust it or there is any to tell interface builder create window for retina pixel size?
Welcome any comment
Thanks
interdev
There's no need to do anything in terms of the various components you layout in Interface Builder, as it's based around points, not pixels - and as all the iPhone screens sizes are the same in points no action is required.
In terms of any images you're loading, you will need to supply higher resolution (twice the pixel size) versions, but as long as these are named "[original name]#2x.[extension]" they'll simply work automatically.
For more information on the image naming, see the "Specifying High-Resolution Images in iOS" section of the Resource Programming Guide and if you want to delve a little deeper, there's a discussion on "Points Versus Pixels" within the Drawing and Printing Guide for iOS.
UPDATE - As of the iPhone 5, the iPhone screens are no longer all the same point size. :-)
The window will be automatically resized for you, you do need concern about the size of your image elements, since retina display uses a bigger size of resolution. You need name your images like this:
regular image name: myimage.png
retina image name: myimage#2x.png
When running in an iPhone4 your program will identify the token "#2x" and change the images for that kind of device.
Design your layout using the size of: 640x960 (double of the original: 320x480)
Good luck.