Confusion on what pixel size to set in new image set

640 Views Asked by At

In Images.xcassets under New Image Set i'm going to use device specific to get the same image for different sizes. I'll be using iPhone 2x, Retina 4 2x, 3x and iPad 1x, 2x. If for iPhone 6+ I want to make an image 40x40 Pixels @3x and for iPhone 6 I want to make the image 30x30 pixels @2x, am I not allowed to do that, is the image supposed to be only 20x20 for 2x? Can I just put both images for example 50x50 one in 2x and other in 3x or is this not allowed?

1

There are 1 best solutions below

5
On BEST ANSWER

Your images have to be exactly the right size, you can't give it any other size.

So 30x30@2x must be a 60px by 60px png file, and 40x40@3x must be 120px by 120px. You multiply the width/height by 2x, and the same for 3x.