Sucking at Retina
zachholman.com
zachholman.com
Or maybe they don't care enough about a tiny fraction of their market to create assets at dramatically higher resolution just to prevent customers from feeling a slight amount of buyer's remorse when they look at their display with a magnifying glass?
Maybe they'd rather have pages load faster for all their customers, instead of serving up needlessly huge image assets to every user? It's not like the WHATWG and W3C have solved this problem yet, they're still bickering over whatever the latest solution is (I don't even know whose fault that is at this point, what a mess)
I still find it incredibly hilarious that owners of Retina macs bitch at content creators because their content looks 'pixelated' when Apple is still too lazy to even run a bilinear filter when upscaling the framebuffer. What is this, 1993? Windows has been able to do this since desktop composition was introduced in Vista.
Also, while we're at it, can we stop referring to these high-density displays by the idiotic marketing term, "Retina"?
It's not a tiny fraction of the market.
Again, if it were easy to feature-detect reliably and only serve the bigger assets up to people on retina devices, I might agree with you.
I've got a high-DPI device and I prefer fast-loading pages every day. If I want things to look incredibly crisp I'll zoom out. Text still looks great!
a) it's nowhere near 4x unless you are using uncompressed images. With something like PNG compression most of the difference is negligible and there've been some interesting experiments showing that with JPEG trading resolution for quality is roughly break-even: see e.g. http://alidark.com/responsive-retina-image-mobile/
b) Even on mobile, latency is WAY more of a factor than bandwidth. If pages load slowly, it's almost always the case that reducing the number of CSS / JS files will help significantly more than reducing image sizes.
c) One of the approaches for dealing with DPI variance is to replace images with vector / webfont / CSS alternatives which don't require scaling. If you do that, you're also going to significantly reduce the total asset size for the page which is going to help everyone get a faster time to paint.
Pages still load as they normally would, and then become progressively clearer. Set a cookie, and all subsequent loads can be sent with only retina quality images.
A little fragile, but it works.
I'd love to see a JavaScript library that does this; I've never run across one.
You can at least detect the 'device pixel ratio', which seems to be > 1.0 for Retina devices, so that's something:
http://stackoverflow.com/questions/11722442/is-there-a-way-t...
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 1.5/1),
only screen and (min-resolution: 144dpi),
only screen and (min-resolution: 1.5dppx) {
width: 260px;
}If you're "Your Local Newspaper" where local is not in California or some other American tech mecca? I don't think you need to care yet...
You can find (someone else's) better argument along similar lines at [2].
[1] I'm exaggerating, a bit.
[2] http://www.red-sweater.com/blog/2568/target-the-forward-frin...
"The Retina MacBook Pro is still very much a luxury item, but we've had a Retina iPad for almost a year and the iPhone 4 for two and half years. And yet, the internet is still having a hard time adopting."
Because the rest of the internet aren't Apple fanboys and unfortunately, that's the massive majority.
The ideal solution - Don't give a shit about Retina displays, because these tiny fraction of Retina users are already 'used to' looking at normal websites in a pixelated fashion. They'll get used to your website too.
Until the retina resolution is adopted by the rest of the Internet, you have my zero fucks.
The interested reader will be glad to know that this is plain to see on a non-retina, 24" 1080p screen. The author might also want to stop messing with the font-weight, its hurting my eyes.
Seriously, developing for multiple density is hard in the real world. Way harder then this article says.
Clearly that's not practical for many sites at this time, but the options are there and it's relatively easy to do if your site is built via the spritesheet style.
I put it up on github here: https://github.com/erikflowers/retina-mixin
The rMBP actually has 5 scaled resolution modes with 2:1 being the 'ideal' 'retina' mode that the laptop defaults to. In 2:1 mode, no filtering is done. Occasionally to get a bit more desktop space I'll shift mine into one of the modes with non-integer scaling to make the desktop bigger, and in those modes filtering is applied. There are two non-integer modes where the scaling is N:1 where N>2 as well. Switch into any of these non-integer scaling modes, though, and screen rendering is slightly but noticeably affected - scrolling windows in particular is much choppier in any of the filtered modes. This is the runtime cost of touching that many pixels in such a large display buffer in order to oversample and filter.
As for why 2:1 mode looks so blurry, I'm guessing that its a combination of pixel glow in low resolution displays smoothing edges and comparison to the relative sharpness of the rest of the OSX UI.
Unfortunately, Apple puts tremendously underpowered Intel GPUs into their Retina macbooks - GPUs that struggle to drive even low-DPI displays or run games at native resolution - and then expects them to drive displays containing 4x the pixels. It's no wonder that scrolling performance is choppy.
One could argue that the choice of terrible Intel GPUs is actually to improve battery life, not to save money; that might be true. But in that case, why not include their (rather well implemented) GPU-switching technology in all Retina macbooks? Why only the 15"?
Are you seriously advocating that Apple use a desktop GPU in their laptops?
Unfortunately, Apple puts tremendously underpowered Intel GPUs into their Retina macbooks - GPUs that struggle to drive even low-DPI displays or run games at native resolution - and then expects them to drive displays containing 4x the pixels. It's no wonder that scrolling performance is choppy.
None of this is true. First, the 15" retina mbp has a nvidia GT650M along with an intel gpu. And it's still not enough. Remember that a game running at 2880x1800 using filtering can use memory-bandwidth saving tricks like quincunx which can't be used in a desktop environment. Moreover, in the 'scaled-up' 1920x1200 mode the rMBP supports, the rMBP is essentially super-sampling a much larger pre-display buffer than 2880x1800
Have a read:
http://www.anandtech.com/show/6023/the-nextgen-macbook-pro-w...
At the default setting, either Intel’s HD 4000 or NVIDIA’s GeForce GT 650M already have to render and display far more pixels than either GPU was ever intended to. At the 1680 and 1920 settings however the GPUs are doing more work than even their high-end desktop counterparts are used to. In writing this article it finally dawned on me exactly what has been happening at Intel over the past few years.
...
To be quite honest, the hardware in the rMBP isn’t enough to deliver a consistently smooth experience across all applications. At 2880 x 1800 most interactions are smooth but things like zooming windows or scrolling on certain web pages is clearly sub-30fps. At the higher scaled resolutions, since the GPU has to render as much as 9.2MP, even UI performance can be sluggish. There’s simply nothing that can be done at this point - Apple is pushing the limits of the hardware we have available today, far beyond what any other OEM has done. Future iterations of the Retina Display MacBook Pro will have faster hardware with embedded DRAM that will help mitigate this problem. But there are other limitations: many elements of screen drawing are still done on the CPU, and as largely serial architectures their ability to scale performance with dramatically higher resolutions is limited.
One could argue that the choice of terrible Intel GPUs is actually to improve battery life, not to save money; that might be true. But in that case, why not include their (rather well implemented) GPU-switching technology in all Retina macbooks? Why only the 15"?
It has a bigger battery.
I applaud their attempts to push the limits of hardware, deliver new and innovative experiences, etc etc etc but ultimately at the end of the day you shouldn't ship optional features that won't work in basic usage scenarios. I think 'being able to scroll a webpage at 60fps' is a pretty basic usage scenario.
I don't understand the claim that a GeForce GT 650m running at 1920x1200 is doing 'more work than even their high-end desktop counterparts are used to' though. That's blatantly false. Furthermore the claim that rendering is largely serial is blatantly, tremendously false - modern GPU architectures are embarassingly parallel and even the kind of rendering Apple does for their UIs can be parallelized to a large extent. Perhaps the intent here is to describe how the workloads that suffer (like scrolling webpages) can't be parallelized?
Thanks for the explanation on the 15", that makes sense - I didn't realize that you could only get a larger battery for the 15".
If you're going to go out there and create a premium end product you might want to think about what 80% of the web is going to look like on it. Perhaps Apple assumed that web designers would be all over this and rolling it out everywhere from day 1?
I don't optimise stuff for retina, mainly because I don't have a retina device so it's partly a case of "out of sight, out of mind" and also without the device to test on it would become difficult to assume anything about how good my retina icons really look.
For LESS, I like "retina.less" from http://retinajs.com/
#logo {
.at2x('/images/my_image.png', 200px, 100px);
}
Could easily be adopted for SASS I'm sure.This avoids the typical double-image downloading (like on Apple's website).
https://github.com/imulus/retinajs/blob/master/src/retina.le...
And if I'm rendering an image JavaScript and want to choose a resolution (like for Gravatar), can detect like this:
app.isRetina = function(){
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
if (window.devicePixelRatio > 1)
return true;
if (window.matchMedia && window.matchMedia(mediaQuery).matches)
return true;
return false;
}();Clearly my personal blog is not a bastion of high design, but it looks pretty decent on every screen I've viewed it on just by following these small prescriptions and testing it during construction on both high and low density displays. It's really not that hard. http://jeffbail.com if you're interested.
That said, since its my personal site, I can do whatever I want and I appreciate fully that is not usually the case at some/most corporations. These folks usually need more than 6 months to make these types of changes, get approval from higher ups, etc...
But here's the thing - IE6 market share is shrinking, and retina display market share is growing. It seems inevitable that given enough time all Apple devices (and potentially many devices from other manufacturers) will come with retina displays. Which is why it makes sense to get out ahead of this trend before retina displays become popular.
Works really well and non-retina clients don't even have to load extra css or javascript for retina images, and retina clients don't have to load the small-version images. Fairly perfect solution... provided you use GWT, I guess, which is rare...
How can I test how my webpages will look on a Retina display, without hardware? I haven't found an answer (admittedly, with only a little searching) that doesn't involve me taking the bus to the local Apple store each revision.
Alternately, get an iPhone 4 or one of the older retina iPod touch models. I picked one up for $80 to do some testing on.
And here is the real solution that fixes resolution and bandwith problems once and for all, atleast for icons and most of the stuff a webpage is made of (which he doesn't even mention once!): SVG. Can we please move on and ship vector graphics (for all non-photo content)?
P.S.: Yes, bad browser support, yada yada yada.. Still, what he proposes is by no means a solution for the real problem. What happens with the next generation displays?!
I understand that there's ways to serve lower res assets to mobile devices, but many of these architectures are already set and updating them to take advantage of media queries is not high on the list of to-dos.
"Rather than optimizing your website for Retina displays, invest your budget on the 30x as many people who have visual/sight challenges."
In the long run, the OP is probably right and we're going to have to deal with retina.
Take 20 minutes and at least redo your logo and key images.
Here's my take on how (short-form of author's post): http://telecuda.tumblr.com/post/26032269612/optimize-blurry-...
Im all for advancement but doing it blindly and you will trip and fall.
a 120x90 image becomes a 240x180 and that's not 2x the pixels, that's 4x the pixels (and bytes.) It's not insignificant. There's great reasons not to bother right now:
1) On phones and tablets people are either going to be zoomed out where they can't appreciate the hi res images, or zoomed in on some text and not really looking at the image most of the time.
2) While I have an rMBP, most people don't. They're starting to get around but for now it's fine. Certainly I agree with the author's advisement to figure out a solution this year, but I disagree with his admonishing of people still putting it off right now.
3) Lots of people who DO have rMBP do NOT run the machine in pure Retina 4:1 resolution. That includes me, I run it in 1920x1200 mode. Most people don't go seem to go that high but even at 1650x1290 "bad" images are much less bad.
Basically, my point is, this isn't as big of a deal as some people make it out to be. I think it's most important for large hero areas and other images that are going to be focus points of your page. But as long as you get on it some time this year you should be fine before a significant portion of your users are thinking your site looks ghetto.
In my experience the 4x pixels works out to something less than 4x bytes assuming jpg or 24bit PNGs because the compression gets more efficient. For instance quadrupling the number of pixels generally doesn't increase the color table by 4x.
I just calculated the difference for about 100 retina files on my sites/apps, and the average size increase is 1.8x.
I don't think this is true -- I don't think the compressed size tends to scale linearly with the raw # of pixels. I did a few tests and saw that using the same compression settings on the larger image typically resulted in an image 3x the size.
There was a post I saw that showed up on HN a while ago claiming you might be better off just using highly-compressed high resolution images for both high-DPI and normal-DPI displays: http://blog.netvlies.nl/design-interactie/retina-revolution/
And the previous HN discussion, since there was a fair bit of disagreement: http://news.ycombinator.com/item?id=4623160