Retina.js: Retina graphics for your website
retinajs.com
retinajs.com
Even more interesting is http://en.wikipedia.org/wiki/JPEG_2000, which has "truncatable" bitstreams. You can stop getting data at any point, and depending on the encoding choices, you'll just lose fidelity in colour, resolution etc. Encoders can reorder the bitstream to deliver whatever is most useful for the image first. Browsers could then just stop when "enough" has been downloaded to satisfy the demands of the device; high DPI devices would just continue to grab more of the bitstream. It's really useful for devices on low bandwidth links, as you start getting visual results with very little data.
JPEG 2000 hasn't been widely implemented outside of specialised devices, mostly because it's computationally heavy compared to JPEG, and the patent situation is unclear. Although this does mean that it could be implemented in a targeted way, designed to solve these problems (the spec for the entire format is huge). Moreover, one of the patent holders is, IIRC, Apple.
The idea truncatable bitstreams is fascinating too. I'm not well versed in networking, but wouldn't the latency of a mobile network kill the benefit of this technique? e.g, by the time the server receives the "connection closed" signal, a large part of the extra data would have been sent, no?
For JPEG 2000, the network characteristics are important, but I don't think it would be too bad on a mobile network. Low DPI devices might get a bit "too much", but it wouldn't be a problem - they can just throw it out (or incorporate more detail).
viewport-dpi - the dpi viewport-max - the maximum possible pixel dimension and possibly viewport-current - the pixel dimensions at the time of the request
Decent responsive design should deal with the differing viewport sizes, but it might be nice to get a hint before delivering your page what direction to weight that response in.
Our goal with retina.js was to make it zero-config: no markup changes, no extra element attributes or flags.
Doesn't really do much to help with the overhead of modifying existing markup. Perhaps if you're already using something like image_tag in Rails, a retina_image_tag helper might not be too much of a stretch.
Then, we can support current image formats in the way you envision.
Also, anything you have vectorized should be in SVG format, including text in non-web fonts.
When $110 buys you 2TB (this morning on Newegg), then doing it on the fly and caching the result has about 100x better ROI than trying to solve it with a smart format. Remember, we're speaking about still photos here, where high retina quality ones rarely take more than 500k each, so 2TB buys you room for 4,000,000 photos (and since you'll be caching the lower res 200K images, it actually buys you room for 10,000,000 million photos)
That's not the case for videos - netflix, hulu and friends have multiple copies of each 1GB optimized for different devices. On-the-fly conversion is not possible, and the stream are significantly difference. For them, a reasonable, universally supported progressive video format will indeed make a huge difference
lower_res {
Request /lowres/*.jpg
Provide /highres/$1.jpg
Downscale 50%,50%
Cached_on /mnt/cheapdisk_that_can_go_away_at_any_time
}
I'm not aware of such an existing module, but I'm sure a good one will appear within the next couple of years of it does not yet exist.Compared to developing and deploying a new progressive format (across users, web servers and web browsers), the effort -- both in developing this module, and in configuration, is negligible.
<meta img-x2-res="_x2" />
Encoding the image twice with a standardized addition to the filename is just an extra bit to add to the export macro. The image storage is irrelevant for most cases (assuming you compress appropriately); it's the bandwidth and request volume that's precious.I'd like to propose a new function for the Images module. This function will allow developers to provide, in a compact manner, multiple variants of the same image at differing resolutions. Using @media pushes the two asset references apart from one another, whereas such a function keeps related asset references together. It also helps keep selectors DRY. We've called it image-set(), and it takes one or more image specifiers.
https://plus.google.com/115203843155141445032/posts/BrrLGL5k...
-webkit-image-set( url(image.png) 1x, url(image@2x.png) 2x )
That's their notation. Imagine having to do that for every image ever, when they're all just filename + 2x resolution key + filename extension. Totally asinine. Developers should just be able to pick a single page-wide filename key for all their 2x assets, and the browser will know to look there.That's their notation. Imagine having to do that for every image ever, when they're all just filename + 2x resolution key + filename extension. Totally asinine. Developers should just be able to pick a single page-wide filename key for all their 2x assets, and the browser will know to look there.
You assume the developers can guarantee all image assets will be 2x. For quite some time, I doubt that'll be the case. And, given that, if the browser just naively requested 2x assets, there would be some set of wasted http requests that just add overhead and significantly delay page load.
Explicitly declaring the 1x and 2x images' existence is a far better solution, even if it is more verbose. The UA can't be guessing about the existence of resources if it's also to be efficient.
<meta img-x2-res="_x2" />
This would alert the browser of the likely presence of 'filename_x2.ext' when it sees img tags, and it would fall back with a second request for 'filename.ext' in case it's not found. This seems relatively easy to implement (especially for web developers), and degrades gracefully on older browsers.Then, a more fleshed out version accounting for the scenario you describe would be the following:
<meta img-x2-res="_x2" assume-present="false" />
Then for any img tags for which double-res assets are available, you could add a property to the img tag as such:<img x2-res="true" />
Or, you could leave the 'assume-present' property off, as 'true' is default, and put '<img x2-res="false" />' on any images for which double-res assets are unavailable. This would avoid a second request when the first fails.
Such a solution would be significantly more convenient for developers, as you could choose whether to assume the presence of 2x and flag ones that don't have it, or assume its absence and flag those that do, saving tons of time.
<img 2x-res="@2x" />
If we wanted this to affect the image asset requested by the CSS background-image and border-image values as well, then a new CSS property would be required for flagging 2x-res active or not and an asset-specific 2x filename key. But its use would be vastly superior to -webkit-image-set, as you could just do this: .class {2x-res: "@2x"}
or: .class {2x-res: "false"}
The only limitation is that these 2x assets must share the same filename with the 1x, except for the addition of a 2x key at the end of the filename. However, that seems to be what people are already doing simply to keep track of their assets, and it's much easier to sell me on this imposition than on having to redo all my CSS in the most redundant and painful way imaginable.It's a high-DPI display. Lots of devices have it. Lets not attempt to pretend there's anything Apple-specific about that.
If people really hated Apple marketing, they probably should be ecstatic at the idea of one of their trademarks becoming genericized.
Two which surprised me were Ping Pong and Adrenaline.
The name "ping-pong" was in wide use before British manufacturer J. Jaques & Son Ltd trademarked it in 1901. (Wikipedia)
(in fact, even more confusingly, most zip() functions don't interleave elements, like zippers do, but return a sequence of paired tuples - this, naturally, gives Zippers a bad name who wants their pants to pairwise join)
So in this sense, I would claim there is a clear technical difference between just higher-resolution screens (more pixels) and retina displays (same pixels but "better looking").
To me this virtualization of pixels seems like a good idea, since the majority of web pages assume pixels have certain DPI range. Operating systems like OSX treat pixels as floats anyway, so if you need subpixel accuracy, it's still possible.
"Retina" is just a marketing term for "pixels so small your eye can't distinguish them at a normal distance anymore".
[0] http://www.w3.org/TR/CSS21/syndata.html#length-units
See also http://inamidst.com/stuff/notes/csspx (been featured on HN some time ago)
Your interpretation is a fine one, but it's not the one that everyone shares. Specifically, it's not the sense that Apple uses the term either. Take a look at Apple's marketing page for the retina display and see if you can find anything about "resolution independence" at all.
Intel played a similar trick about 8 years ago with "Centrino". The advertising (for what was essentially just a 802.11b chipset with some added processor/chipset requirements) was so successful that many novice users got fooled into thnking that "Centrino" was wifi, and that all those other manufacturers were just cheap knockoffs of an Intel technology. It did great harm to the market.
Really? Both the claim that many users were "fooled" by the Centrino branding and that this hurt the market for Wi-Fi devices seem highly implausible to me. I don't think I heard anyone use the term "Centrino" outside of Intel PR and reporting thereupon, whereas Wi-Fi had made it into the vernacular at least a decade ago.
The only other trademark for the 802.11 series of standards that got any traction at all was Apple's AirPort, and even their OS calls it Wi-Fi now.
(edit: your remark about AirPort makes this clearer on reflection: you were a mac user at the time, and familiar with Apple products much more than PCs. Outside the mac world, as you might expect, literally no one had heard of an "AirPort". So you were insulated from Intel's nonsense, essentially.)
It's the same thing here. We have "retina.js" being pushed around as a solution for what is clearly a manufacturer-independent problem. Yet on it's face it appears to be Apple-only software. You don't think that constitutes harm to the market?
Apple introduced laptops with Wi-Fi (calling it "AirPort") in 1999, five years before your "eight years ago". Starbucks first started rolling out Wi-Fi (calling it "Wi-Fi")in 2001, and had most of their stores offering it by 2003. It was not an obscure technology eight years ago.
I'm sure whenever non-geeks go shopping for a computer, in any era, there are a variety of marketing terms that need to be explained to them. And yes, I'm old enough to have run through that exercise a few times. But that's not really evidence that "Centrino" hurt the growth of Wi-Fi any more than the way-more-prevalent "Pentium" branding hurt the '90-'00's highly competitive CPU market that gave us 2+GHz x86-64's.
Wi-Fi adoption rates were exceptional for a new computing technology, especially one that required infrastructure beyond what could be put "in the box".
Just like Apple was a couple of years ahead of the curve on Wi-Fi and called it AirPort, they're a couple of years ahead of the curve on double-res displays, too. I don't see how them putting the name "Retina" on those displays (while even in the OS they're still calling it Hi-DPI!) is going to harm what's surely going to be an explosion of high resolution screens in the next few years.
To get a Centrino sticker, a laptop had to use an Intel chipset, Intel wireless adapter and Intel CPU. Because the marketing for Centrino focussed almost exclusively on Wifi capability, there were many laptops with non-Intel chipsets or AMD CPUs that were perceived by customers as not being capable of wireless networking.
This article[1] explains how Wi-Fi wasn't very popular until the Centrino campaign.
[1]: http://www.siliconvalleywatcher.com/mt/archives/2011/04/inte...
Anyway, I'm perfectly content to believe that Centrino and Intel's multimillion dollar marketing campaign for it really helped the growth of Wi-Fi. The parent post claimed the opposite: That the branding "hurt the market" for Wi-Fi, which seems absurd.
It's why we have brands and markets. So we can associate them with _something_ and move on from terms such as 486DX 33Mhz.
People want to buy an "iPads", not the Apple K48 tablet (the internal name for the first iPad.
... And when I bought a laptop in 2005, yes, I did buy a "Centrino" one because I knew the Intel Wifi chipset combination was compatible with Linux.
... And Intel put out some other requirements and called them "Ultrabooks".
Now, we still have a way to go before high ppi displays are ubiquitous, but there you have one example at least :)
That said, there is nothing gimmicky about the retina name. It's a device where distance to the display, resolution and screen size are such that someone with normal vision cannot distinguish between pixels.
High-PPI does not in any way pack the same information. It’s ambiguous and unclear.
The only thing that’s bad about retina is that Apple uses it like a trademark. I would love it if any company could call their HD TVs retina displays (because they are), but that’s not possible. Luckily everyone else is busy taking away that name from Apple (for example by naming their software like that).
It is a post-development sales pitch used to pitch as a differentiation the fact that Apple's naive scaling required them to grossly overshoot the mark. Competitive products already had excellent displays before Apple decided that they had no choice but catch up.
I would love it if any company could call their HD TVs retina displays
Why would you love it? "Retina" display is a misnomer -- unless the device is a fixed distance from my eyes, and it is specifically geared for my eyes specifically, it is horse shit to call it a retina display. It is ignorant marketbabble that lowers us all.
It’s a petty good approximate term that to my mind works perfectly well. Sure, things change depending on view distance but I guess nerds have to survive a term that’s not always exact. The horror!
That was an uninformed rant on your part. What are you suggesting as an alternative? High-PPI certainly does not work.
Do you actually believe that the magical "retina" mark just coincidentally happened to be 2x Apple's original resolutions? How convenient!
It’s a petty good approximate term
It's a marketing term that the stupid embrace. Is a 64Kbps mp3 "eardrum audio" in a standard room with a fan? Is 128Kbps eardrum audio on a crummy mp3 player?
That was an uninformed rant on your part
What was uninformed about it? Desperately curious to hear what.
AC.Retina._devicePixelRatio = 2
new AC.Retina
you will see several requests such as: HEAD http://www.apple.com/home/images/ipad_title_2x.pngDepending on the data contract, the user experience when viewing their mobile phone bills might be affected negatively though.
Accept: RETINA
Something like that, at least then you could turn it off in the browser.
http://www.priteshgupta.com/2012/04/detecting-ipad-3-for-spe...
PS: you may wish to add a "(-webkit-min-device-pixel-ratio: 2)" clause to your media queries if you want to target retina devices.
Ideally, we'd have something that would deliver only the correct image to the correct device, the first time. I haven't seen a clean method for achieving that yet.
So I would be cautious of using this technique with huge images.
But we have so-called experts trying to lead the way now...
http://www.archer-group.com/2012/development/javascript-jque...
1. The image doesn't have a src attribute. This means if that script fails for any reason then none of the images on your site load.
2. You need to have width and height attributes on all of your images. This is a nightmare for both dynamically generated content and for responsive designs.
3. You need to have those two extra attributes on each of your image elements in order for it to work.
Our goal was to make retina.js zero-config. We wanted it to work on existing sites without any changes to the existing markup.
We had originally written it in JavaScript, but decided to use CoffeeScript simply because it's nicer to read and write.
That said, this is why CSS3 is so valuable, particularly when responsive websites have already complicated the process of building a website/app.