I'm trying to understand the different image asset resolutions in Xcode/iOS development and I can't seem to wrap my head around it.
I use sketch 3 to develop the images I use in my apps.
So let's say I have an art board set up at the iPhone 5 size. I've used this art board to create my images at the sizes I want them to be when displayed on an iPhone 5. Would I export these images as 1x or 2x?
I've read that the iPhone 5 and 6 use the #2x resolution but this is where I start getting confused. If I've created the images at the iPhone 5 dimensions would I really want to up the pixel count?
Any clarification would be much appreciated!
All Artboards are in 1x resolution.
When you export you should be doing it at 2x. For iPhone 6, 5, 4.
You should really be exporting all your assets at all 3 sizes since iOS 9 still supports the older 1x on iPad 2 (should your app also support iPad)
My artboard on Sketch is 640 x 1136 px, which is 2x. I exported my icons and images at 0.5 times, 1 times, and 1.5 times for 1x, 2x, and 3x respectively.
However, when I implemented them on the app, the size of the icons and images appear to be different from that of the mockup, which is a 640x1136 1:1 scale.
Am I missing something here?
I would like tips and examples of other design folks' design workflow from Sketch to mobile while handling the normal and Retina resolutions.
Thank you very much!
Other things to note:
-Exported using Sketch
-Yes I suffixed them correctly for Xcode
640 x 1136 should be the size of your image for #2x, refer to this handy guide for the different screen sizes.
which device(s) have you been testing on? for #3x it doesnt seem like a 1.5x multiplier so i could see why it maybe not working for that device size, but if its not working on #2x and at #1x device im not sure, are you using the asset manager? maybe make sure all the image buckets are filled correctly
I simply want to display a title page to a game. I want to use pre-rendered images. It needs to work with all iPhones and iPads. So far I am using these assets as screenshot below
I have used these sizes:
In 1x place image with resolution of 320 x 480.
In 2x place image with resolution of 640 x 960.
In Retina 4 2x place image with resolution of 640 x 1136.
In 3x place image with resolution of 1242 x 2207.
Only the iPhone 4 and 5's show correctly. Both 6 and 6Plus are completely wrong.
for iPad:
1x image of 760*1024
2x image of 1536*2048
Only the iPad 2 displays correct. The Air and Retina are completely wrong.
I have read through all the documentation I can find both on here and searching for hours on Google. I am unsure what simple thing I must be overlooking. Am I trying to do something that is not possible? I am only testing on the simulator and thinking it could be an issue with that?
Also I may have a misunderstanding then as I was under the impression that #3x was for iPhone 6 and 6+. If not, what are #3x for?
For some reason Image Sets in Asset Catalogs do not include a size for iPhone 6 or iPhone 6+, so when using a full screen image you may need to handle it manually via code.
What I'm doing (and it's not pretty but it works), is to include another Image Set for iPhone 6 (I all it imageName_47), and another one for iPhone 6+ (I call it imageName_55). Then in code, detect the screen size and swap the image to the best size. You'll only need the #2x version for the _47 one, and the #3x version for the _55 one.
Currently working on a universal SpriteKit project. I'll be supporting the following devices:
iPhone 4/s,
iPhone 5/c/s,
iPhone 6,
iPhone 6+
iPad non-ret,
iPad retina
I am confused on the iPhone part. I already have 4 versions for my background sprite for the 4 different screen resolutions of the iPhones. But which goes to which?
I know the 3x is for the 6+, and I think the 5/c/s goes to the Retina 4 2x, but I do not know where the iPhone4/s, and 6 go. Anyone know?
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
Also how do you guys approach creating images/sprites for a universal application? Now that the new iPhone 6, and 6 plus are out, I have 2 more resolutions to support which is still confusing for me as I'm still a beginner.
This is a little confusing - here's how I understand it (this is in reference to the top image):
1x images are for the original iPhone through the 3GS - 'standard' resolution devices (3.5" screens)
2x images are for the iPhone 4 and 4S (3.5" Retina screens) and are 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+ (5.5" super-Retina [3x] screen)
I believe that the iPhone 6 (4.7" screen) will use the Retina 4 2x images, but I would have to test it.
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
If you compare the two images, the lower one has everything the upper one does, except for a 1x iPhone graphic. You don't need that if you're only supporting iOS 7 and above, since iOS 7 doesn't run on any non-Retina phone-form devices. To be honest, I don't understand why the top image has a 1x iPhone form graphic option - maybe because you checked the "iPhone" box in the sidebar?
Also how do you guys approach creating images/sprites for a universal application
For most non-fullscreen images (like a logo), you really only have 3 resolutions to support - standard (1x), Retina (2x), and the iPhone 6+ (3x). These are simply different quality of images, not really different sizes. So if you have a 10x10 image on a standard device, that would mean you need a 20x20 image on a Retina device and a 30x30 image on an iPhone 6+. On all devices, they would show up as a 10x10 image.
A great tool I used for managing different resolutions of icons is iConify.
I create them at the highest size I need (30x30 [#3x] for an image I want to be 10x10 on a device), then save it as a png and resize copies to 20x20 [#2x] and 10x10 [standard]. A better solution would be to create and use vector graphics, which would resize better to any size.
In 1x place image with resolution 320 x 480.
In 2x place image with resolution 640 x 960.
In Retina 4 2x place image with resolution 640 x 1136.
in 3x place image with resolution 1242 x 2208.
Images of Retina 4 2x will upscale to resolution 750 x 1334.
Images 3x will downscale to resolution 1080 x 1920.
You can also visit this links for launch screen images:
http://www.paintcodeapp.com/news/iphone-6-screens-demystified
http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
For all other images resolution and size:
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
https://developer.apple.com/ios/human-interface-guidelines/graphics/image-size-and-resolution/
https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/
How to use Image.xcassets:
https://www.youtube.com/watch?v=_36Y6rDcKP0&list=PLXCowKcXAVgrCe2Lezv0acRf4adQLshv2
Hope this will be more helpful.
If you have your launch images in an xcasset file, you can do the following in Xcode 6.
Select the launch image asset, select a specific resolution (1x, 2x, Retina 4, etc) and open the attributes inspector (see image below).
Under the "Image" section, you will have a "Expected Size" attribute.
Inside images.xcassets, you can add different devices support by right clicking as shown in the snap
Edit: Well, it doesn't seem working when I drag n drop images to placeholders. It gets messed up as shown next
I don't know why it is acting odd on my Xcode 6.4 though.
Edit#2:
I see a bug from apple here. I can select 'Universal' along with any device upon right click as you can see in the first image above. But via attribute inspector I can correctly select either 'Universal' or specific devices as shown here
Edit#3:
In Xcode 7 the attribute inspector has been changed and now it gives option same like the right click. So instead of either 'Universal' or specific devices, now it offers to select all.
There is one tool : AVXCassets Generator with which you can directly generate XCAssets file for all your icons and images just by one click.
hope you will like it.
So I have a game that I made in Swift and I built it and all of its assets for the iPhone 5s. So naturally when built for a 4s or an iPad the game looks distorted and the image views are in the wrong place.
How do I get around this so that the game can work on both the 4/4s and 5/5s? Where do I put the smaller images? I see the 1x and 2x but what exactly does this mean?
Every iPhone since the iPhone 4 in 2010 has a Retina Display. Now we have iPads with Retina Display, too.
You can have an asset named "image1.png" and a higher resolution version of the same asset named "image1#2x.png". Adding the "#2x" to the end of the file name, iOS knows which asset to use based on the current device's display.
Regarding your "So naturally when built for a 4s or an iPad the game looks distorted and the image views are in the wrong place" comment: what you want to pay attention to here is the actual screen size of the devise you're designing for.
The iPhone 4/4S has a screen resolution of 640 x 960 pixels, while the iPhone 5/5c/5s has a screen resolution of 640 x 1136. The iPad's screen resolution for Retina Display models is 2048 x 1536.
So, I think that your problem is not about creating the assets, but about how you arrange them on screen.
I'd recommend taking a look into an AutoLayout tutorial.
Hope I've shed some light on your problem.