Background image size on iPhone - ios

Hello I have made a background image (size: 1136 x 650). Then I have implemented it into my app but on iPhone 5 it is too small though in all the guides I read they said that 1136x650 would be the size for a background image on iPhone 5. Then I have used the same image but with size: 2272x1300 (#2x) and now it fits perfectly.
Does that mean that I have to use a background image with the size: 2208x1242(normal) and 6624x3726 (#3x) for an iPhone 6+?

The number of physical pixels in the screen and the number of points in the screen's coordinate system are different numbers. As you have discovered an iPhone 5 has four times as many physical pixels on the screen as logical pixels.
For iPhone 6, in order to fill the whole screen in landscape orientation, you would need a 1334 x 750 image. For the 6+, you would need a 2208 x 1242 image. A quick way to tell is to check the requirements for the launch image, which you can get to from here.

Related

Image sizes for iPhone are incorrect-

I have this image called image.png - I have created it in the 3 differen't sizes.
image#3x.png - 1001x132px
image#2x.png - 668x88px
image.png - 334x44px
What I dont understand is how come the #2x is 668px in width, when the iPhone 5&5S are only 640px wide?
I have designed the #3x using iPhone 6+ screen size.
Could someone please explain?
Let me explain you the difference between the iPhone screens, so you will understand the need of these #?x suffixes.
The first iPhone, and the two after it (3G and 3GS) had the standard display with dimensions w:320, h:480. With the introducing of iPhone 4, Apple also introduced the so called Retina display, which "packs" 4 physical pixels in 1 logical pixel (also called "point"), i.e.:
Now, even though the pixel dimensions of the iPhone 4 are w:640, h:960 (and iPhone 5/5C/5S w:640, h:1136), you still have screen size of w:320, h:480 points (respectively w:320, h:568 for 5/5C/5S). But because the coordinate system of the display uses points instead of pixels, the dimensions and position in points of all UI elements remains the same for every device.
What about the prefixes?
Now, the ratio between point and pixels is called "scale". UIScreen, UIView, UIImage, and CALayer classes have a property called scale, and when you load image with prefix #2x, the scale will be 2.0 and the display will fit 2x2 bitmap pixels from the image in one point. iPhone 6+ uses the #3x suffix because of the Retina HD display, which has scaling factor 3 and the image is afterwards downscaled from rendered 2208 × 1242 pixels to 1920 × 1080 pixels (points on the screen).
The downscaling ratio is 1920 / 2208 = 1080 / 1242 = 20 / 23. That
means every 23 pixels from the original render have to be mapped to 20
physical pixels. In other words the image is scaled down to
approximately 87% of its original size.
(source).
Required image sizes
For example if you want to have an image of green circle in a black square with dimensions w:100, h:100, you will need two more images: one with dimensions w:200, h:200 and one with w:300, h:300, as the system will scale them according to the suffix.
Where to go next
Here is some stuff to read (if I didn't explain it right or easy to understand). My advice: check the link above and the official Apple documentation for further knowledge:
Apple documentation: Supporting high-res devices
Apple documentation: Points vs. Pixels
#2x is using for retina display, like iphone 4, 4s, 5, 5s, 6, ipads ....
The image has 668px in width, I think it use for a view that could have extra area for view, like horizontal scroll view, tutorial pages, or for ipad ... ... or something like that ..
And yes, you're right about the width of retina display, it is just 640px.
Hope this may help.

iPhone 6 addressable screen size

The new iPhone 6 has been announced, and there are multiple posts about the number of pixels and the pixels per inch. That's great, but ignores an important question for developers that I don't seem to be finding anywhere.
What's the addressable screen size?
For example, the iPhone 5 has a 4" screen with 1136x640 pixels. Cool. But if I'm programming for it, the addressable screen size is 568x320. If I draw a line from 0,0 to 568,320 (in landscape mode, full seem, of course) it goes across the entire display, not half of it.
The iPhone 6 has two new pixel sizes, 1334x750 and 1920x1080 for the iPhone 6 Plus. Presumably, this means the addressable screen space for programming is 667x375 for the iPhone 6 and 960x540 for the iPhone 6 Plus. Can anyone confirm that?
Also, the simulator now has a variable size setting, but doesn't come preset for the new iPhones. Do you set the simulator to 1334x750 or 567x375 to set layouts for the iPhone 6?
The iPhone 6 has a scale of 2 so the point size is 375 x 667 (not 375 x 567).
The iPhone 6+ actually has a virtual pixel size of 1242 x 2208 with a scale of 3. So the point size is actually 414 x 736.

iOS background size of images

What size of image I need to have if I want to use it as background to full screen?
1.png 320 - 568 points non retina
1#2x.png 640 - 1126 points retina
Am I right? Or what size are correct?
You could use the size of the splash screen images for your views too, making your app iOS 7 forward compatible.
For iPhone 5 and iPod touch (5th generation):
640 x 1136 pixels
For other iPhone and iPod touch devices:
640 x 960 pixels (retina)
320 x 480 pixels (standard resolution)
It depends on what device you're targeting. If you looking at just the iPhone 5/5s then you're spot on. If you're also taking into account everything below the iPhone 5, then you will also need
320x480 (non retina)
640x960 (retina)
So it just depends on the devices you're supporting. There are loads of resources on the net about these things. Also bear in mind that the background size will be different depending on what components you use, such as navigation bars and tab bars. And also if you're supporting iOS 7 then the status bar is transparent, where as on iOS 6 and below, you don't need to provide the background for that (so the above dimensions are actually correct for iOS 7 but not exactly right for iOS 6)

Launch image manager for iOS

Table 5-4 (about half way down) this Apple doc page suggests sizes for the launch images for iOS:
Device Portrait Landscape
iPhone and iPod touch 320 x 480 pixels Not supported
640 x 960 pixels (#2x)
iPhone 5 640 x 1136 pixels (#2x) Not supported
iPad 768 x 1024 pixels 1024 x 768 pixels
1536 x 2048 pixels (#2x) 2048 x 1536 pixels (#2x)
My app has a photo background at launch so at present I have to use GIMP to crop/resize the photo for each of these, which is fiddly.
Is there a tool to do this automatically ?
One other complication is that there are a couple of logos in the image too, ideally they will be in separate layers, so they can stay legible and tidily laid out for each size/orientation.
There is not a tool that I know of do do this. But there is a button in the Xcode Organizer, under Screenshots, labeled “Save as Launch Image”. If you set up your code to dynamically generate the image you want, you can run your app on various devices and grab images of it running, and then use those images as your launch images. You may have to modify them a little bit, but it’s certainly easier than creating each one from scratch.

iPhone Launch image for a landscape based application

The problem is that the launch image I have set up isn't showing up I speculate its because its dimension are for portrait but since its landscape based it isn't showing up and I have set up all my launch images correctly on the asset catalog now the thing is I don't know if I'm supposed to set it up as portrait under Deployment info and later then coding for it to once it has completely launched and loaded to stay in landscape and not rotate to portrait I notice that on my asset catalog I don't have an image with the dimensions 320x480 it never asked me for it you know how it has slots well in my project it never gave me one pertaining such dimensions (320x480) it only had two slots for iPhone portrait which were "#2x" (640x960) and "R4" (640 x1136)
Update
I tried changing the dimension from 640x960 to 960x640 but I got an error as soon as I added to the catalog because those weren't the right dimensions
More Details : apple doc
portrait only available in xcode for launch image but you can customize your image. create image landscape mode the portrait size through attached to xcode. it's works perfectly and display image as landscape
Create launch images in different sizes for different devices. Launch images for all devices must include the status bar region. Create launch images in the following sizes:
For iPhone 5 and iPod touch (5th generation):
640 x 1136 pixels
For other iPhone and iPod touch devices:
640 x 960 pixels
320 x 480 pixels (standard resolution)
If at all you still want to view the splash screen in landscape mode you have to design the image in such a way as we cannot change the behavior of the splash screen.
Instead of designing the image as 640x960, design it as 960x640 and your problem will get solved.
Edit:
This is sample splash image in portrait dimension but designed in landscape view
All the best.
The iPhone only uses ONE launch image -- portrait
only the iPad supports orientations during launch
what many do:
have no launch image
make sure applicationDidFinishLaunching returns as soon as possible(!)
show your own splash screen view
do your real loading only THEN
I was going to comment on #Warrior's answer but StackOverflow won't let me.
You shouldn't need to specify an iPhone 5 optimised image (I haven't for my app and it works), although if this is a new app I would recommend it.
Are you running it on an iOS 7 device?
I have noticed that Xcode allows you to add a 1x and 2x image specific to iOS 5 & 6 devices.
Otherwise all I can suggest is checking your dimensions (it must be a portrait sized image 640x960px) and be placed in the '2x' slot) and also make sure your info plist is pointing to the correct location.
Then as others have suggested, all you need to do to get a landscape image is have artwork that is rotated 90 degrees when your image is portrait.
The screen size and Icon size for iOS.
ICONS (iPhone and iPad)
29 x 29pt (1x and 2x)
40 x 40pt (1x and 2x)
50 x 50pt (1x and 2x)
57 x 57pt (1x and 2x)
60 x 60pt (2x)
72 x 72pt (1x and 2x)
76 x 76pt (1x and 2x)
NOTE: 2x is double the size of 1x images
SCREEN SIZE
iPhone 4s and earlier (3.5 inch)
320 x 480 pts
Retina
640 x 960 pts
iPhone 5 (4 inch)
320 x 568 pts
retina
640 x 1136 pixels
iPad protrait
768 x 1004
retina
1536 x 2008
iPad Landscape
1024 x 748
retina
2048 x 1496
OTHER IMAGE SLICING
All image slicing requires both 1x and 2x to work perfectly for retina and non retina displays.
NOTE: 2x is double the size of 1x images.
Normally you add both a portrait and landscape image to the asset catalog and the device chooses which one to use based on the current device orientation.
If your app only supports landscape then you only need to provide a landscape image, as long as you set the "Device Orientation" in your info plist to be "Landscape Left" and "Landscape Right" ONLY.
In that case, the user will always be presented with a landscape launch image and this will indicate to them that they need to rotate their device.
- Anthony

Resources