MonkeyBlue
MonkeyBlue

Reputation: 2234

Can iOS Retina images have odd dimensions i.e. 28 x 15 px?

We are currently working with a design who is supplying Retina images to us with odd dimensions i.e. 28 x 15 px which I believe is incorrect as when you divide it you get an odd number like 14 x 7.5 px.

This is a rule I have always worked on but the designer is not getting the point and I thought I should double check what the exact rules are.

I've had add look on the web but cannot seem to find any references on this so it would be great to hear what everyone thinks on this matter.

Thanks

Upvotes: 2

Views: 1314

Answers (3)

R.Lambert
R.Lambert

Reputation: 1170

It's not possible because in Xcode you design your application with classic resolution pictures, and you can't use a float for width or height. So, you will have a one pixel gap difference between your classic and retina design. Maybe the easiest way to solve your problem is to add a transparent line of pixels in your high resolution picture.

Upvotes: 0

marramgrass
marramgrass

Reputation: 1411

The @2x image needs to be exactly twice the width and twice the height of the standard image, or the automatic loading of it won't happen - your app will load and pixel-double the non-Retina image.

The standard image file will as a matter of course be a whole number of pixels wide and high, so you'll need the @2x to be even in its dimensions.

Tell your designer to catch on ;)

Upvotes: 1

Raptor
Raptor

Reputation: 54212

Yes you can, but NOT recommend.

For example, if you have an @2x image with 28 x 15px , your normal image will be 14 x 8px.

If you look close into the normal image, the pixels are not aligned well.

It is always recommended to use even number of pixel in dimension.

Upvotes: 5

Related Questions