tags:

views:

87

answers:

3

Hi,

I am having a problem in iphone 4. The images used in iPhone less than 4 are fine but when I upgraded to iphone 4 the images looks distorted.

Here is the link.

The image size I have used is 320 x 480.

http://img822.imageshack.us/img822/8431/download22.png

Thanks.

+2  A: 

The fact is that the resolution of iPhone4 is 960x640 instead that 480x320 so the image is scaled with linear (or bilinear, not sure) filtering.. the result is what you get: a blurry image.

Just redo the image with the proper resolution to solve the problem, you mainly notice these kinds of artifacts because you have rasterized text on an image..

You obtain this effect whenever you resize an image to fit a wider area of pixels: the missing pixels must be filled somehow and filtering comes into play. So you will have to consider also that part of the screen is used by the top bar to have an exact sized picture.

Jack
+1  A: 

Create a @2x suffix to each of your png that you use. example: Icon.png [email protected]

The runtime environment will choose the double-resolution on retina display devices.

Chen Harel
What would be the difference between that and it simply scaling the image the way Jack described? More intelligent filtering?
Gallen
you mean suffix
Thanks but i load the images dynamically from the file. then how can i know i should write 1.png or [email protected]?
How do you load them? Odds are, you still use 1.png and iOS gets the 2x image.
Steven Fisher
A: 

It looks like your original image is 480x320, but you aren't accounting for the fact that the status bar is compressing your image slightly (or perhaps it does on the iPhone4 but on the older iPhones it is cropping instead).

I'd check the image view settings for that background image.

Kendall Helmstetter Gelner
you are absolutely right. Thanks for everyone. Everyone has given the right answer but my case is solved by this answers. should use 320x 460 for background image if using status bar. Thanks to all of you.