Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images blurry in iphone 4 mobile safari

I'm making a mobile web app and am having some trouble with my images. They look great on my desktop but all blurry in the iPhone. I guess it's cause' of the retina display and that mobile safari needs to double the size of the web sites.

Is there a workaround to get the images to appear crisp on the iPhone 4?

like image 297
Johan B Avatar asked Dec 19 '11 13:12

Johan B


People also ask

Why are my images blurry on safari?

In Safari on iOS, there is a known limitation when displaying large PNG and GIF images. The issue is triggered by the overall number of pixels in the image, so even if an image is narrow, you can experience blurriness if the image is tall enough. This affects both the iPad and iPhone and affects all models of device.

Why are my iPhone pictures suddenly blurry?

If your Photos and Videos are stored in iCloud and you share it before downloading the original then it may appear blurry but it is not. Your photos and videos are stored on your device in their original, high-resolution version. This means that they use a lot of space on your iPhone, iPad, and iPod touch.

Why are iPhone pictures blurry on Android?

Once you send something via SMS, your carrier gets involved and that data gets terribly compressed. While data compression affects all images and videos, it typically impacts larger or high-quality images the most. Videos are also heavily affected, and usually, end up extremely blurry and unwatchable.


1 Answers

I have found the answer. I found this article: http://seesparkbox.com/foundry/targeting_iphone_4s_retina_display_with_media_queries Which advocates using media queries like this:

@media only screen and (-webkit-min-device-pixel-ratio: 2) {
    #map-page .ui-icon {
        background-image: url("/images/retina/4_ikon_hitta.png");
    }
}

This works for now but i not an optimal solution. In the comments of another article there where talk about not using pixels as a measurement at all, which made perfect sense. The iPhone4 is just the first of many high dpi-devices to come. So a pixel will be even more sizes in the future.

Mobile Safari have since ios 2.1 support for SVG so depending on what devices you have to support SVG (maybe with some fallback) is something to strongly consider.

For my (and yours too!) next project I'm digging in to ems, points, % and SVG.

like image 61
Johan B Avatar answered Sep 28 '22 04:09

Johan B