Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Is that really being used that much?

All I've seen is:

&width=xxx&height=xxx

and

&width=xx%&height=xx%.

The latter is percent of display. A generally nice way to go since the full width of the browser window will always be exactly used. However images will be scaled, which IMHO is not good. OTOH specifying exact sizes (the former) works great for images but means if you have a wide display with lots of pixels, the width isn't utilized, and if you want to make the window narrow you get horizontal scroll bars.

Okay! Now I understand you. That's not how the RMBP works (or the iPad, iPhone, Android, or others for that matter). Everything is displayed as if the screen were of a standard resolution (e.g. 1440x) even when there are far more pixels available (e.g. 2880x). If you create a basic HTML document and toss an <img> in there with no size rules it will display at double size (as if your screen were only 1440x from the example above. Meaning it won't display in Retina resolution. It might if you request the image directly (not sure) and it does in OS X, but not the browser.

Thank you. A very informative description (your whole post, not just what I quoted). I don't have a RMBP and didn't know how it handles it. Basically the browser is introducing intelligence which basically fails for images because of the pixel doubling rather than true resizing which would use interpolation to fill in the extra pixels. So it could actually be handled "properly" but at the expense of performance.
 
Temporary problem, stop complaining. Eventually sites and programs will update until then suck it up and enjoy those asymmetrical fans.
 
The problem with providing higher resolution images on websites is several problems, actually.

In all of these examples, let's assume that I want the image element to be 320px by 240px. My source image is 3200x2400 (to make the math easier).

First thing I'll note is that the HTML standard defines the inch, and then defines 1 pixel as 1/96 of an inch. However, in practice, most web browsers go the other way around and define an inch as 96 pixels. HiDPI Apple browsers define an inch as 192 pixels (upscaling if elements don't have enough information), and on IE on Windows, an inch can be 96, 120 (Win7 1.25x), 134.4 (Win8 1.4x), 144 (Win7 1.5x), or 172.8 (Win8 1.8x) pixels by default (with some registry hacking, you can get more settings, but those are the defaults).

So, due to the ubiquity of 96 ppi browsers, common practice is to downscale the image to 320x240. This is the most efficient as far as bandwidth, but you can see the results.

Maximum compatibility including with future devices is had by uploading the 3200x2400 raw image to the server, and then using the width and height attributes to force the browser to draw the image at 320px by 240px (note that in this case, px is the HTML pixel, or 1/96 of what the browser thinks is an inch, and not an actual pixel). However, this greatly increases the bandwidth requirements for both server and client, as well as increasing the processing requirements for the client significantly.

The simplest way to do this is to stick a 640x480 image in there, and use the width and height attributes to restrict it to 320px by 240px. However, this still results in unnecessary information being sent to devices other than Apple retina devices, increasing bandwidth requirements, and it now provides a sub-optimal image for scaling on the Windows devices running their browsers at higher than 96 ppi.

Apple does things a little differently on their site (and there's a third-party implementation as well, Retina.js). They point the web page at a 320x240 image, so 96 ppi browsers get an appropriate image. Once the images have loaded, some JavaScript runs, checking for some Apple-specific extensions to the browser, and if present, changes the img elements to grab @2x - 640x480 in this case - versions. This works well for saving bandwidth when most users visit, but actually increases bandwidth use for HiDPI users. Worse, it's an Apple-specific implementation.

What I'd like to see is some standard, either in the user-agent, or in a new HTTP field, that specifies the browser's logical PPI. Then, the server could elect to serve an image that's appropriate, caching the common sizes, and using ImageMagick to generate uncommon sizes on demand (I believe MediaWiki already has support for the on-demand scaling for this method, but doing it via filename instead). A workaround for now would be to use JavaScript to detect the logical PPI, then set a cookie, and retrieve that cookie on every image load (or, use that cookie to determine what images to grab by filename, maybe, but I don't like special filenames for this due to the possibility of filename collisions), but that's clunky.

In any case, this won't actually affect me much - I'll be running at 96 logical ppi. That means my GAF is rather low for updating my own site. I'll wait until there's a vendor-neutral standard before I do that - Microsoft is going to want there to be a good standard for this that isn't so Apple-specific as the current one, so it will happen.
 
It's so easy to make your website retina capable. If you've ever worked with print it's a similar concept. You don't have to change your work if you design with vectors.

As it is on rMBP you can essentially design at 72ppi, no different from any other screen. Then you simply export your image with a certain resolution, say 220ppi for the rMBP. On your website you can use JS to check the screen scaling and substitute the appropriate style sheet based on the result. It's the same process we're all used to in trying to get things to work cross browser or to recognize mobile devices. Except the difference in this case is anyone who gets this experience is seeing your site with it's visual appeal tripled.

This capability actually makes it EASIER to design for the web because designers no longer have to fart around with shadow and highlight "hinting" to manipulate low res screens into showing details that are lost when your work in AI or PS is scaled and exported for 72ppi. Seeing my work at retina resolution on the rMBP has been a visual pleasure no other screen can provide. It's truly beautiful.

Anyone who doubts that Retina screens won't take over hasn't had the pleasure of using one. It's over and done with, 220ppi is the gold standard now.

so if 220ppi is the gold standard, what about ipad and iphone retina displays that aren't 220ppi? you're saying you're going to export a different image for every single retina device? totally wrong way to do it.
 
Apple does things a little differently on their site (and there's a third-party implementation as well, Retina.js). They point the web page at a 320x240 image, so 96 ppi browsers get an appropriate image. Once the images have loaded, some JavaScript runs, checking for some Apple-specific extensions to the browser, and if present, changes the img elements to grab @2x - 640x480 in this case - versions. This works well for saving bandwidth when most users visit, but actually increases bandwidth use for HiDPI users. Worse, it's an Apple-specific implementation.
That is certainly a kludge of a solution, in both efficiency and visual appeal (the redrawing is noticeable, apparently).

What I'd like to see is some standard, either in the user-agent, or in a new HTTP field, that specifies the browser's logical PPI.
Would a pixel-ratio media query not work?




Michael
 
so if 220ppi is the gold standard, what about ipad and iphone retina displays that aren't 220ppi? you're saying you're going to export a different image for every single retina device? totally wrong way to do it.

What would you suggest?

I think that's the best way to do it honestly, assuming you can automate creation of the alternate resolutions... which you can do easily in PS I'm sure you're aware. If you really wanted to get smart about it, having the server create images for a particular scaling the first time it's requested would also work.
 
So, can anyone actually explain WHY would it be smart to concern yourself with dpi value in photo editing software when creating new image for website? Isn't dpi value there simply for print?

The latter is percent of display.
Isn't it percentage of that image (in pixels)? So image with resolution of 100x100 and 50% tag would be displayed as 50x50 image?
 
Last edited:
It doesn't have to be as complicated as you outlined, nor is it right now. You can pretty much handle it by creating a 2x resource (e.g. 640x480 px image@2x.png for a 320x240 image.png graphic) and using CSS to tell high resolution clients to use the higher resolution graphics. Some tweaking may be necessary (e.g. turning something into a background image) but it's manageable without much fuss. And there's JavaScript and server side combinations for other approaches. There's no need care about the size of an actual pixel beyond the ratio deduced through CSS or JavaScript.

Yes, it would be nice if something even simpler is done down the road, but we've already got a history of high resolution screens out there—the cat is out of the bag.
 
Thank you. A very informative description (your whole post, not just what I quoted). I don't have a RMBP and didn't know how it handles it. Basically the browser is introducing intelligence which basically fails for images because of the pixel doubling rather than true resizing which would use interpolation to fill in the extra pixels. So it could actually be handled "properly" but at the expense of performance.
I would argue that it actually is being handled properly in that a consistent experience is by far the most important thing to strive for on the internet. Although if the browser did resize images to retina clarity (effectively halving the space they occupy on either axis) I don't think there would be a performance concern. It would instead become an accessibility concern. It's one I get a glimpse of regularly as I browse old non-Retina web graphics in the Finder and see how small and difficult to read or understand they frequently become when not pixel doubled.

This all comes down to the reason why web designers will use image tag attributes or CSS to control the dimensions of an image. It is frequently important that an image occupy a certain space for clarity, understanding, or simply so it doesn't look awful in the design they've carefully crafted.
 
so if 220ppi is the gold standard, what about ipad and iphone retina displays that aren't 220ppi? you're saying you're going to export a different image for every single retina device? totally wrong way to do it.

On Apple retina devices running in HiDPI mode, the browser always runs at 192 ppi. That is, the logical HTML/CSS unit called the "inch" is made of 192 pixels. (And, as 1 px in the context of HTML/CSS is 1/96 of an inch, 1 px is always two real pixels.)

So, one image will work optimally for all Apple retina displays.
 
It doesn't have to be as complicated as you outlined, nor is it right now. You can pretty much handle it by creating a 2x resource (e.g. 640x480 px image@2x.png for a 320x240 image.png graphic) and using CSS to tell high resolution clients to use the higher resolution graphics.
When creating that image in photo editing software, would you bother to type in dpi value of the image and if yes - why? Thank you.
 
Last edited:
When creating that image in photo editing software, would you bother to type in ppd value of the image and if yes - why? Thank you.
No. There's no reason to worry about this and you only need to create one retina graphic for HiDPI devices regardless of whether they scale by a factor of 1.5 or 2 (as is the case with Macs, though there is actually some browser-to-browser variation on other mobile platforms).

At a high resolution, it just doesn't matter. Provide the high resolution graphic and do some manual optimization if necessary (might include some of the same careful adjustments that might be made for normal graphics when working with the likes of small icons) and you're good. In Photoshop, the pixel count is what you care about and that's what the web browser is going to work with.

Here's a flow chart which actually does a good job of outlining the process for 'Retinifying' a website. Nowhere near as complicated as some here are suggesting it should be.

http://f.cl.ly/items/012n0O023v2S2N1m3Q1t/How to Retinafy your Website.pdf
 
I guess I just don't get it. My iPad has a retina display and websites look great with it. Why can't! Or doesn't, the MBP do the same thing?

Because these devices have a smaller screen. Safari on iOS scales down websites to make them fit better on the screen. As a result images have a higher effective resolution and look better on the hi-res display. You can achieve the same effect by zooming out in a desktop browser.
 
No. There's no reason to worry about this and you only need to create one retina graphic for HiDPI devices...
Thank you! So, there is no direct connection between dpi value in photo editing software and the way image will "behave" on a website, right? So, why do people keep bringing it into conversation about "retinizing" websites?
 
Last edited:
Thank you! So, there is no direct connection between ppd value in photo editing software and the way image will "behave" on a website, right? So, why do people keep bringing it into conversation about "retinizing" websites?
I suppose the answer to the first question is, 'there doesn't have to be'. What matters for the web is the dimension, in pixels, of that graphic, and nothing else really needs to matter (at least in terms of image dimensions). On your web page you'll present something at a certain size and for HiDPI displays you'll use an image with more detail, defined in the same space, to take advantage of the extra pixels on that screen. There's no rule that it has to be 2x, but 2x is a pretty good number to shoot for. Various responsive web design techniques may result in different image sizes being used because the image is being used in different areas, or images which scale along with the layout, so those will require a little more thought, but again, the basic rule still applies. You have one resolution which is right for the typical computer monitor, and then the 2x resolution image which is used for HiDPI devices and displays.

I have no idea why people keep bringing it up. Maybe one of the reasons for misunderstanding is that some people are overlooking the fact that HiDPI devices don't scale down a website in relation to their screen DPI. The website is, instead, scaled up (1.5x or 2x, generally) to remain consistent with the appearance one would expect from that same device if it has a more traditional screen. Images are displayed at higher resolutions by defining a larger image into a smaller space (e.g. 640x480 in 320x240) and the crisp text is handled by the operating system (OS X, iOS, Android, Windows 8, whatever).
 
Last edited:
I sure hope that people don't start redoing their websites so they look prettier on retina displays. The internet is already slow enough as is. I don't need to see the MacRumors image logo in hi-res.
 
Thank you! So, there is no direct connection between ppd value in photo editing software and the way image will "behave" on a website, right? So, why do people keep bringing it into conversation about "retinizing" websites?

because retina display effectively scales an image to twice the size to make up for the fact that the screen PPI is super dense. 'normal' images that get scaled will look blurry/fuzzy. 'retinized' images which are generally 2x the scale will look nice and sharp.

graphics that can be replaced by css will always be nice and sharp.
 
I sure hope that people don't start redoing their websites so they look prettier on retina displays. The internet is already slow enough as is. I don't need to see the MacRumors image logo in hi-res.

The internet has become slow because website builders fill their sites with google analytics, adverts, facebook links and all that whatnot. A bigger image hardly makes a difference when the site is already that complex. And, with progressive jpegs, the site loads just as quickly, but improves as you wait. Trouble is, there aren't many programs that make efficient progressive jpegs easily and well, that's why we still need to run Paint Shop Pro in a virtual window!
 
I sure hope that people don't start redoing their websites so they look prettier on retina displays. The internet is already slow enough as is. I don't need to see the MacRumors image logo in hi-res.

in two years pretty much every display will be "retina like" in its density. by then hopefully people will learn to code and well all have better bandwidth
 
because retina display effectively scales an image to twice the size to make up for the fact that the screen PPI is super dense. 'normal' images that get scaled will look blurry/fuzzy. 'retinized' images which are generally 2x the scale will look nice and sharp.

graphics that can be replaced by css will always be nice and sharp.
What? I am talking about dpi value that you type in when you are creating new image in Photoshop or almost any other photo editing software. I was not talking about ppi value of display.
 
Last edited:
Oh my, every time I wanted to write "dpi" - dots per inch, I wrote ppd - pixels per degree. My bad.

Ah, I see. FYI: PPI and DPI is the same thing.

I have been playing around doing some arithmetics to calculate rMBP PPI. Actually it is: 220.53 pixels per inch.

The formula: PPI = SQR(Width_in_pixels^2 + Height_in_inches^2) / Diagonal_in_inches = SQR(2880^2 + 1800^2) / 15.4 = 3396.23 / 15.4 = 220.53 pixels per inch

To calculate width and height resolutions in inches:
Width_in_inches = 2880 / 220.53 = 13.06 inches
Height_in_inches = 1800 / 220.53 = 8.16 inches

My 2cents :)
 
Ah, I see. FYI: PPI and DPI is the same thing.

I have been playing around doing some arithmetics to calculate rMBP PPI. Actually it is: 220.53 pixels per inch.

The formula: PPI = SQR(Width_in_pixels^2 + Height_in_inches^2) / Diagonal_in_inches = SQR(2880^2 + 1800^2) / 15.4 = 3396.23 / 15.4 = 220.53 pixels per inch

To calculate width and height resolutions in inches:
Width_in_inches = 2880 / 220.53 = 13.06 inches
Height_in_inches = 1800 / 220.53 = 8.16 inches

My 2cents :)
Believe me, I'm familiar with it even more than I should be.
DPI is usually used to express print quality / density of print, while PPI is limited to displays. Sometimes, print does not actually mimic pixels which can make comparing PPI and DPI tricky.
 
Believe me, I'm familiar with it even more than I should be.
DPI is usually used to express print quality / density of print, while PPI is limited to displays. Sometimes, print does not actually mimic pixels which can make comparing PPI and DPI tricky.

yes, DPI is print.

DPI (Dots Per Inch) is used to determine how large an image will print. You can an image with 220ppi print at 72dpi.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.