Some explanations for iOS xcasset catalogs required - ios

I am completely new to iOS development. I want to make a small game with the Sprite-Kit framework and I am already stuck at the xcasset catalog.
Say I have a 320x320 pixel image for my iPhone 4s that features a resolution of 960x480 pixels. I put this to "iPhone 2x" in the xcasset catalog, right (cp. following image) ?
Now, do I need for the "iPhone 1x" a 160x160 and for the "iPhone 3x" a 640x640 version of the image? What about the iPad ? What does "iPad 1x" and "iPad 2x" exactly mean in terms of pixels? Is "iPad 1x" also 320x320 and "iPad 2x" 640x640 in my example ?
EDIT-1: Thanks for the link to the possible duplicate. But there's also not discussed what exactly the iPad version are for and how they are related in terms of pixels.
EDIT-2: The resizing results with Asset Catalog Creator are not satisfying, although I used a 4096x4096 pixel image to produce the launch images (cp. following image):

It looks like your Sky image isn't set for "universal devices" which is why it's asking about iPad images. See Apple's Asset Catalog Help for more info about why you'd want device-specific images.
Select the Sky image name, then hit Command-Opt-4 to open the Attribute Inspector. Where it says "Devices" set it to "Universal" and you should just see the "Universal" section with the 1x, 2x, & 3x image wells.
Also, your sample image sizes seem off. If your #2x image (for iPhone 4s) is 960x480 then the 1x image would be 480 x 240. (and your 3x image for use on the iPhone 6+ would be 1440 x 960.) Your 1x image should be whatever point size you want, the 2x should be twice that in both dimensions, and the 3x should be three times the 1x in both dimensions.

I think all that matters are the different display densities of those devices:
- iPhone 6 Plus 401 ppi
- iPhone 6 326 ppi
- iPhone 5, 5c, 5s, iPod touch 326 ppi
- iPhone 4, 4s, iPod touch 326 ppi
- iPad mini (2G/3G) 326 ppi
- iPad (3G/4G), iPad Air 264 ppi
- iPhone 1, 2, 3 163 ppi
Thus resulting in 1x (264 ppi), 2x (326 ppi), 3x (401 ppi) independent of the actual screen size in pixels.

Related

Understanding image sizes in Xcode

I apologise if this has been answered but I can't seem to understand no matter where I look. I have been trying to make a Chess game using SpriteKit in Xcode. I don't understand the 1x, 2x and 3x options in the assets folder.
It seems like the image is the smallest when I put it in 3x, which seems counter-intuitive. Also, what resolution is best to design for? It doesn't seem like the actual iPhone resolutions are used in the iOS simulator.
Thanks
You get a great overview from apples docs:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
Basically, you need images with higher resolution for devices with higher resolution. If an icon is 32x32 pixel for iphone 3, you add an 64x64 image for iphone 4 (retina, #2x) and an 96x96 image for iphone 6 (even higher resolution, #3x).
1x , 2x , 3x is different size of images according to different phone's resolution.
You can find imagesize according to device resolution in below link.
IconMatrix
Basically,
#1x images are for the iPhone 3GS - 'standard' resolution devices (3.5" screens)
#2x images are for the iPhone 4 and 4S which contain 3.5" Retina screens and also used for the iPhone 6.
Retina 4 #2x are for the iPhone 5 and 5s (4" Retina screens)
#3x images are for the new iPhone 6+,iPhone 6S+ (5.5" super-Retina [3x] screen)
Note :- As describe by apple in document
For all images and icons, the PNG format is recommended
Also, what resolution is best to design for?
The biggest resolution you will need. In most cases, #3x. So if the image "is" 10x10, design it being 30x30 for the #3x files, and scale down to smaller resolutions.
• 30x30 is the pic#3x.png
• 20x20 is the pic#2x.png
• 10x10 is the pic.png
The simulator uses the image according to the device it is simulating. So the iPhone 6S+ will use #3x if available.
PNG is the recommended extension, and you can use http://tinypng.com to reduce the file size, including splash screens.

IOS launch images - driving me crazy [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Apple does not provide a clear list for image file size I should use for:
retina hd 5.5 portrait ios 8,9
retinia hd 5.5 portrait ios 8,9
retinia hd 5.5 landscape ios 8,9
iphone portrait ios 2x 7-9
iphone portrait ios retina 4 7-9
ipad portrait ios 1x 7-9
ipad portrait ios 2x 7-9
ipad landscape ios 1x 7-9
ipad landscape ios 2x 7-9
etc.
As I intend to use swift I can only suppose ios7+ that means I can ignore all he other sizes for ios5+6. Is that correct?
(One could also go LaunchScreen.storyboard solution, but that has higher iOS requirements so for now it seems better to include launch images.)
How to solve the issue of creating all launch images in correct dimensions?
Note to those who put this question on hold:
I originally asked if anyone knew of a list with specifications. Apparently that was why you closed the answer 3 years later after I posted it. But in essence this question is and was a programming question regarding Apple API specifications with precise answers possible. It is not a question seeking opinion based answers.
For anyone finding this now i've created a list to simply explain what each of Apple's somewhat confusing names actually mean.
iPhone Portrait iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 1242px x 2208px - Default-736h#3x.png
Retina HD 4.7 (iPhone 6) - 750px x 1334px - Default-667h#2x.png
iPhone Landscape iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 2208px x 1242px - Default-Landscape-736h#3x.png
iPhone Portrait iOS 7-9
2x (iPhone 4) - 640px x 960px - Default#2x.png
Retina 4 (iPhone 5) - 640px x 1136px - Default-568h#2x.png
iPhone Portrait iOS 5,6
1x (iPhone 3) - 320px x 480px - Default.png
2x (iPhone 4) - 640px x 960px - Default#2x.png
Retina 4 (iPhone 5) - 640px x 1136px - Default-568h#2x.png
New Dimensions table for Xcode Version 9.0
iPhone X Portrait iOS 11+
iPhone X : 1125x2436px
iPhone X Landscape iOS 11+
iPhone X : 2436x1125px
iPhone Portrait iOS 8.9
Retina HD 5.5 : 1242x2208px
Retina HD 4.7 : 750x1334px
iPhone Landscape iOS 8.9
Retina HD 5.5 : 2208x1242px
iPhone Portrait 7-9
2x : 640x960px
Retina 4 : 640x1136px
iPad Portrait 7-9
1x ; 768x1024px
2x : 1536x2048px
iPad Landscape iOS 7-9
1x : 1024x768px
2x : 2048x1536px
iPhone Portrait 5,6
1x : 320x480px
2x : 640x960
Retina 4 : 640x1136px
iPad Portrait Without Status Bar iOS 5,6
1x : 768x1004px
2x : 1536x2008px
iPad Portrait 5,6
1x : 768x1024px
2x : 1536x2048px
iPad Landscape Without Status Bar iOS 5,6
1x : 1024x748px
2x : 2048x1496px
iPad Landscape 5,6
1x : 1024x768px
2x : 2048x1536px
Although not pretty I use this quick way
1. Create a new LaunchImage and drop any file onto each box
2. Build it , it will fail or have some warnings
3. Click on the "Show Report navigator" and you'll see the sizes/names for each
4. On your image editor resize the image to the proper sizes/names and overwrite to
the respective file as reported in 3. each file is on
<proj dir>/Assets.xcassets/LaunchImage.launchImage
Do the same for icons and don't look back
I use a LaunchImage set. Click Images.xcassets from the files list. In the next column to the right, you may need to use the "+" button to add AppIcon and LaunchImages image sets. These will have slots for every supported (expected) screen size. If you use these sets, you don't have to worry about encrypting your image files with Apple's indecipherable naming scheme, you just drag each image file to the corresponding slot in the set.
Of course, one still has to know the actual dimensions associated with 1x, 2x, retina4, Retina 4.7, Retina 5.5, etc. I'd certainly prefer Xcode to just show the required dimensions of each image, but it doesn't. Barring that, I'd love a single table from Apple listing all the expected dimensions, but that doesn't seem to exist, either. It looks like Apple has, thankfully, consolidated all of this information in the https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/ under the "Graphics" section. Specifically, as of this writing for devices supported on IOS10:
Device Portrait size Landscape size
iPhone 6s Plus, iPhone 6 Plus 1080px by 1920px 1920px by 1080px
iPhone 6s, iPhone 6 750px by 1334px 1334px by 750px
iPhone SE 640px by 1136px 1136px by 640px
12.9-inch iPad Pro 2048px by 2732px 2732px by 2048px
9.7-inch iPad Pro, iPad Air 2,
iPad mini 4, iPad mini 2 1536px by 2048px 2048px by 1536px
As with the other answers I use an Asset Catalog and simply drop files into the LaunchImage slots in the Asset Catalog in Xcode. Then I find my app in the Products Group of the Xcode Navigator (tall pane on the left) and Show in Finder. Any copy of your app package will do. Then I Show Package Contents on my app and all the LaunchImage*.png files are there. I just added a portrait launch image for the iPhone X. To see the names and sizes of the immages I navigated to the package in Terminal and ran the file command on the LaunchImage*.png files.
% file LaunchImage*.png
LaunchImage-1100-2436h#3x.png: PNG image data, 1125 x 2436, 8-bit/color RGB, non-interlaced
LaunchImage-700-568h#2x.png: PNG image data, 640 x 1136, 8-bit/color RGB, non-interlaced
LaunchImage-700-Landscape#2x~ipad.png: PNG image data, 2048 x 1536, 8-bit/color RGB, non-interlaced
LaunchImage-700-Landscape~ipad.png: PNG image data, 1024 x 768, 8-bit/color RGB, non-interlaced
LaunchImage-700-Portrait#2x~ipad.png: PNG image data, 1536 x 2048, 8-bit/color RGB, non-interlaced
LaunchImage-700-Portrait~ipad.png: PNG image data, 768 x 1024, 8-bit/color RGB, non-interlaced
LaunchImage-700#2x.png: PNG image data, 640 x 960, 8-bit/color RGB, non-interlaced
LaunchImage-800-667h#2x.png: PNG image data, 750 x 1334, 8-bit/color RGB, non-interlaced
LaunchImage-800-Portrait-736h#3x.png: PNG image data, 1242 x 2208, 8-bit/color RGB, non-interlaced
I was dealing with a similar issue to adapt to new iPhone X new screen size and came across this link
It helped me, maybe it will help someone else
It's so confusing. Can anyone align the sizes along with the names. Is there a link.
So far I have only this from the other list that seems at all helpful.
The dimensions themselves are helpful only 1/2 way. We need to be able to associate it to the referencing png.
Here's what I have so far, but it's far from complete. Is there a complete list:
iPhone Portrait iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 1242px x 2208px - Default-736h#3x.png
Retina HD 4.7 (iPhone 6) - 750px x 1334px - Default-667h#2x.png
iPhone Landscape iOS 8,9
Retina HD 5.5 (iPhone 6 Plus) - 2208px x 1242px - Default-Landscape-736h#3x.png
iPhone Portrait iOS 7-9
2x (iPhone 4) - 640px x 960px - Default#2x.png
Retina 4 (iPhone 5) - 640px x 1136px - Default-568h#2x.png
iPhone Portrait iOS 5,6
1x (iPhone 3) - 320px x 480px - Default.png
2x (iPhone 4) - 640px x 960px - Default#2x.png
Retina 4 (iPhone 5) - 640px x 1136px - Default-568h#2x.png
Launch image for the iPhone Portrait Mode
iPhone X Portrait iOS 11+ (image size 1125 × 2436 pixels)
Retina HD 5.5″ (image size 1242 × 2208 pixels)
Retina HD 4.7″ (image size 750 × 1334 pixels)
iPhone Portrait 2x (image size 640 × 960 pixels)
iPhone Retina 4 (image size 640 × 1136 pixels)
For background images you will need 4 sizes to support the above devices in portrait orientation. They can be stored in whatever folder in your project that you are keeping standard images in. The sizes needed are as follows…
• 640 x 960 (iPhone 4s)
• 640 x 1136 (iPhone 5s)
• 750 x 1334 (iPhone 6)
• 1242 x 2208 (iPhone 6 Plus)
• 1125 × 2436 (iPhone X)

iOS #2x images conflicting

I've a little confusion and facing a little problem regarding #2x images in iOS as according to Human Interface Guidelines HIG, the #2x For iPhone 6: 750 x 1334 (#2x) for portrait but same #2x for iPhone 4S has size of 640x1136.
HIG
When I placed #2x image named as MyTestImage#2x.png of size 750 x 1134, it was fine for iPhone 6 but not for iPhone 4S, but if I put MyTestImage#2x.png of size 640x1136 then its fine for iPhone 4S but not for iPhone 6.
I also placed 640x1136 as Retina 4 2x named as MyTestImage-568h#2x.png but its also not working for me.
Whats I'm conflicting? What should be the actual image sizes of #2x for iPhone 4S and iPhone 6 if I talk about a full screen image.
And also what should be the correct retina display image size.
EDIT 1:
My question is different as I want to know the difference between #2x and -568h#2x retina display regarding both screens. Also, any optimal solution for this which can avoid image redundancies.

Image Sizes for Supporting iPhone 4S,5,5C/S,6 and 6+

I want to support a variety of devices from iPhone 4S to iPhone 6+. Previously, when adding supporting for iPhone 5, we followed the following steps.
Add the launch Default-568h#2x.png
Use the same #2x images (640x960) which are resized automatically for iPhone 5.
Now, iPhone 6 and 6+ are introduced with varying sizes and it is written on most blogs that we will use #2x for iPhone 6 and #3x identifier for iPhone 6+. It is also written that:
iPhone 6+ (#3x) images will have resolution of 1242x2208 (I am using portrait mode), and it is automatically downsized.
iPhone 6 will use #2x images.However,I am not sure what the size of these images should be. Should they be 640x960 or 640x1136 or 750 x 1334. In case of using the first two sizes, won't the images be distorted?
I think what you are after is detailed in the HIG under "Icon and Image Sizes"
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1

Issue with iPhone5 and iPhone6 #2x images

What is the official iOS naming convention for(#2X),
iPhone 6 :
667x375 points 1334x750 pixels 2x scale 1334x750 physical pixels 326 physical ppi 4.7"
iPhone 5 :
568x320 points 1136x640 pixels 2x scale 1136x640 physical pixels 326 physical ppi 4.0"
iPhone 4 :
480x320 points 960x640 pixels 2x scale 960x640 physical pixels 326 physical ppi 3.5"
so, that device recognise the image(with #2X) is for iPhone 6, iPhone 5 or iPhone 4?
There is no publicly exposed way to differentiate your images between the various device sub-types. If you must load a separate image depending upon whether your app is running on an iPhone 4s, 5, or 6, you will need to perform the detection of the device and loading of the proper image entirely in your own code (use the screen size to differentiate).
You may try #3x, though I haven't checked it.

Resources