<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    >

<channel>
    <title>Webmonkey &#187; responsive images</title>
    <atom:link href="http://www.webmonkey.com/tag/responsive-images/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.webmonkey.com</link>
    <description>The Web Developer&#039;s Resource</description>
    <lastBuildDate>Fri, 05 Apr 2013 20:20:46 +0000</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=3.4.2</generator>
    
    <item>
        <title>Forget JavaScript, It&#8217;s Time for Browsers to Speed Up Images</title>
        <link>http://www.webmonkey.com/2012/12/forget-javascript-its-time-for-browsers-to-speed-up-images/</link>
        <comments>http://www.webmonkey.com/2012/12/forget-javascript-its-time-for-browsers-to-speed-up-images/#comments</comments>
        <pubDate>Wed, 19 Dec 2012 20:48:01 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=60411</guid>
        		<category><![CDATA[Responsive Design]]></category>
		<category><![CDATA[Web Basics]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/12/faster_w.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/12/faster_w.jpg" alt="Forget JavaScript, It&#8217;s Time for Browsers to Speed Up Images" /></div>Images make up roughly 60 percent of the data downloaded with the average webpage. It's great that browser makers have been focused on improving JavaScript, but if we really want to speed up the web it's time to tackle images as well.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_56148" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg" alt="" title="Photo_AdobeShadow2012-03-01" width="580" height="328" class="size-full wp-image-56148" /></a><p class="wp-caption-text">So many screens, so many images (testing responsive sites with <a href='http://www.webmonkey.com/2012/03/adobe-shadow-simplifies-mobile-web-testing/'>Adobe Shadow</a>). <em>Photo: Adobe</em></p></div></p>
<p>The average webpage is now 1.2 megabytes and around <a href="http://httparchive.org/interesting.php#bytesperpage">60 percent</a> of that rather large payload comes from images. That&#8217;s a lot of data, whether you&#8217;re <a href="http://www.webmonkey.com/2012/08/w3c-proposes-responsive-image-solution/">handling images responsively</a> or just trying to speed up a desktop site.</p>
<p>You might think, if images are the bulk of what your browser is downloading, that browsers would be working hard to speed up the image downloads, perhaps trying alternate, space-saving image formats, but you&#8217;d be wrong.</p>
<p>You might also think that, as Google&#8217;s Ilya Grigorik <a href="http://www.igvita.com/2012/12/18/deploying-new-image-formats-on-the-web/">writes</a>, &#8220;innovating on better image formats would be a top agenda item&#8221; for the web. But again you&#8217;d be wrong. The web is still using the same image formats it&#8217;s been using virtually since the first images appeared online. </p>
<p>Grigorik thinks it&#8217;s high time that changed and we agree.</p>
<p>In a recent post looking at what it would take to <a href="http://www.igvita.com/2012/12/18/deploying-new-image-formats-on-the-web/">deploy new image formats on the web</a>, he writes, &#8220;if we really want to make an impact on web performance, then image formats is the place to do it&#8230; there is absolutely no reason why we shouldn&#8217;t have dozens of specialized formats, each tailored for a specific case and type of image.&#8221;</p>
<p>Of course no web developer wants to deal with dozens of specialized image formats. Nor should they need to &#8212; that&#8217;s a job for servers. &#8220;In a world with dozens of image formats,&#8221; continues Grigorik, &#8220;the human solution does not scale &#8212; read, markup does not scale&#8230; whereas computers are fantastic at doing exactly the kind of optimization work required to solve the problem.&#8221;</p>
<p>Grigorik isn&#8217;t alone in calling for new image formats, nor is he the first to suggest handing these tasks off to the server. Developer and responsive images proponent Matt Wilcox has <a href="http://2002-2012.mattwilcox.net/archive/entry/id/1079/">argued</a> for a similar solution, as have others.</p>
<p>The basic premise of these arguments is that deciding which image to serve up to which device and browser should be a server-side problem. And in fact there&#8217;s already a way to solve this problem with HTTP headers, namely the <code>Accepts</code> header, which tells the server which image formats the browser supports. Based on that information the server could then &#8220;re-encode, recompress, resize, strip unnecessary metadata and deliver the optimal format.&#8221;</p>
<p>The problem is that web browsers (with the exception of Opera) don&#8217;t actually send useful information in the <code>Accepts</code> header. </p>
<p>Thus, the first step in creating a server-side solution for smaller images is to get other browsers to send useful <code>Accepts</code> headers. </p>
<p>The <code>Accepts</code> header isn&#8217;t a magic bullet by any means, but it&#8217;s a problem that&#8217;s not hard to solve provided browser makers prioritize it. But to really get server side image solutions working the web would also need new server tools (fortunately, <a href="https://developers.google.com/speed/docs/mod_pagespeed/filter-image-optimize">several</a> already <a href="https://github.com/pagespeed/ngx_pagespeed">exist</a>). There are other stumbling blocks as well. Grigorik addresses half a dozen potential problems and objections that you can read through in his post.</p>
<p>Even if browser makers come around to the idea and do start improving <code>Accepts</code> headers, bringing better image formats to the web is going to be an uphill battle. But Grigorik is determined to chase the idea. &#8220;Some uphill battles are worth fighting,&#8221; he writes in a comment, &#8220;I think this a good one. Wish me luck.&#8221;</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/12/forget-javascript-its-time-for-browsers-to-speed-up-images/feed/</wfw:commentRss>
        <slash:comments>7</slash:comments>

        
    </item>
    
    <item>
        <title>W3C Publishes First Draft of HTML Responsive Images Extension</title>
        <link>http://www.webmonkey.com/2012/08/w3c-proposes-responsive-image-solution/</link>
        <comments>http://www.webmonkey.com/2012/08/w3c-proposes-responsive-image-solution/#comments</comments>
        <pubDate>Thu, 30 Aug 2012 17:33:07 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=58783</guid>
        		<category><![CDATA[Responsive Design]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[responsive images]]></category>
        <description><![CDATA[The web needs a better way to serve images. One size fits all doesn't cut it in the increasingly mobile world. To help web developers cope with varying screen sizes, resolutions and bandwidth, the W3C is considering a new Responsive Images Extension for HTML.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_56148" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg" alt="" title="Photo_AdobeShadow2012-03-01" width="580" height="328" class="size-full wp-image-56148" /></a><p class="wp-caption-text">So many screens, so few images (testing responsive sites with <a href='http://www.webmonkey.com/2012/03/adobe-shadow-simplifies-mobile-web-testing/'>Adobe Shadow</a>). <em>Photo: Adobe</em></p></div></p>
<p>The web needs a more intelligent way to serve images; one-size-fits-all doesn&#8217;t work in an increasingly mobile world.</p>
<p>Web developers need a way to specify images based on screen size, bandwidth and other factors. To help them do that the W3C, the group that oversees the HTML standard, has published the first editor&#8217;s draft of the <a href="http://dvcs.w3.org/hg/html-proposals/raw-file/tip/responsive-images/responsive-images.html">HTML Responsive Images Extension</a>. The proposal is just a draft, but it points to one possible solution for the responsive image conundrum.</p>
<p>The problem is this: No one wants to waste bandwidth sending large images over limited mobile pipes, but everyone wants images to look good on the myriad screens connecting to today&#8217;s web. Developers need to send small images to small screens and large images to large ones. Currently, web authors use a variety of hacks to (incompletely) work around the problem, but to really solve it the web needs new tools. </p>
<p>The new proposed Responsive Images Extension is hoping to be that new tool. The proposal is one of the first community-created specs, coming from the work of the <a href="http://www.w3.org/community/respimg/">Responsive Images Community Group</a>. The spec is edited by developer Mat Marquis, who represents the Community Group, and Microsoft W3C member Adrian Bateman. </p>
<p>The draft seeks to find a middle ground between the <a href="http://www.webmonkey.com/2012/05/ready-or-not-adaptive-image-solution-is-now-part-of-html/">WHATWG&#8217;s proposed <code>srcset</code> attribute for the <code>img</code> tag</a> and what many web developers want &#8212; a new <code>&lt;picture&gt;</code> element.</p>
<p>The goal for developers is to have a simple, but backward-compatible way to serve images based on screen pixel dimensions, density, user zooming and bandwidth. For the latter image choice would be left up to the browser. </p>
<p>In addition to those basic requirements, the Responsive Image Extension proposal has other goals:</p>
<blockquote>
<ul>
<li>Fallback gracefully on older user agents</li>
<li>Can be polyfilled effectively</li>
<li>Retains, at a minimum, the same level of accessibility as current img element</li>
<li>Preserves separation of content markup and styling</li>
<li>Provides a purely client-side solution that can include JavaScript, but doesn&#8217;t require it</li>
<li>Supports use cases where authors need to explicitly define different image versions as opposed to simply different resolutions of the same image</li>
<li>Provides a consistent and predictable pattern for delivering alternate media sources based on client context</li>
<li>Supports succinct but understandable mark-up</li>
</ul>
</blockquote>
<p>Put it all together and clearly the HTML Responsive Images Extension has its work cut out for it. Here&#8217;s some sample code showing how the proposed <code>picture</code> element might handle all that:</p>
<pre class="brush: js">
&lt;picture alt=""&gt;
    &lt;source media="(min-width: 45em)" srcset="large-1.jpg 1x, large-2.jpg 2x"&gt;
    &lt;source media="(min-width: 18em)" srcset="med-1.jpg 1x, med-2.jpg 2x"&gt;
    &lt;source srcset="small-1.jpg 1x, small-2.jpg 2x"&gt; 
    &lt;img src="small-1.jpg"&gt; 
&lt;/picture&gt;
</pre>
<p>The first line contains a media query aimed at large screens and the uses the <code>srcset</code> attribute to specify two images, one for standard resolution displays and one for high-DPI screens. The second line handles medium size screens, while the third handles smaller screens and serves as the fallback for low-bandwidth situations. The last line uses the standard <code>img</code> tag for older browsers.</p>
<p>It&#8217;s a mouthful of markup, but it&#8217;s similar to how the HTML5 <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code> tags work. Unfortunately it&#8217;s sufficiently different enough to be confusing. As Philip Jagenstadt of Opera Software <a href="http://lists.w3.org/Archives/Public/public-html/2012Aug/0431.html">notes</a>, &#8220;personally, I don&#8217;t think it’s a good idea to reuse the syntax of <code>&lt;video&gt;</code> + <code>&lt;source&gt;</code>, since it invites people to think that they work the same when they in fact are very different.&#8221; He goes on to add that &#8220;this is neither a &#8220;yay&#8221; nor &#8220;nay&#8221; from Opera Software, just my POV from working on HTMLMediaElement.&#8221;</p>
<p>And therein lies one big problem for the HTML Responsive Images Extension &#8212; browsers aren&#8217;t on board with it just yet. </p>
<p>For now that&#8217;s fine, the draft is, at this stage, just a proposal in search of feedback. If all goes well browser makers will now step into the fray to enumerate their concerns and any potential pitfalls on the implementation side. And there are pitfalls, including potential conflicts with browsers&#8217; &#8220;look-ahead&#8221; parsers, but hopefully over time those will be worked out.</p>
<p>If you&#8217;ve got ideas on how to improve <code>&lt;picture&gt;</code>, head over to the <a href="http://www.w3.org/community/respimg/">Responsive Images Community Group</a> and let them know what you think.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/08/w3c-proposes-responsive-image-solution/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>How Do You Use Responsive Images?</title>
        <link>http://www.webmonkey.com/2012/08/responsive-images/</link>
        <comments>http://www.webmonkey.com/2012/08/responsive-images/#comments</comments>
        <pubDate>Mon, 27 Aug 2012 16:32:52 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=58665</guid>
        		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Responsive Design]]></category>
		<category><![CDATA[Visual Design]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/08/adobe-screens-w.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/08/adobe-screens-w.jpg" alt="How Do You Use Responsive Images?" /></div>Getting the right images to the right screens is a delicate balancing act. No one wants to waste bandwidth sending large images over limited mobile pipes, but every web developer wants their images to look good on the multitude of screens connecting to today’s web.  So how are you handling responsive images?]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_56148" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg" alt="" title="Photo_AdobeShadow2012-03-01" width="580" height="328" class="size-full wp-image-56148" /></a><p class="wp-caption-text">That's a lot of screens, are your images ready? (testing using <a href='http://www.webmonkey.com/2012/03/adobe-shadow-simplifies-mobile-web-testing/'>Adobe Shadow</a>). <em>Photo: Adobe</em>.</p></div></p>
<p>No one wants to waste bandwidth sending large images over limited mobile pipes, but everyone wants their images to look good on the multitude of screens connecting to today&#8217;s web. Finding the balance between the myriad factors &#8212; screen resolution, screen size, bandwidth, layout and design &#8212; is a tricky process.</p>
<p>We&#8217;ve looked at a number of <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">techniques for handling images in responsive designs</a>, but one thing that we haven&#8217;t covered is where to put the actual breakpoints. </p>
<p>You&#8217;re probably familiar with breakpoints in responsive design, they&#8217;re the screen widths in your media queries. For responsive images the idea is the same; a &#8220;breakpoint&#8221; is the screen size at which you swap in and out different size images.</p>
<p>At first glance it might seem logical to use the same breakpoints for your images that you&#8217;re using in your CSS media queries, but as Cloud Four&#8217;s Jason Grigsby writes, that&#8217;s not always the ideal solution. Grigsby tackles the potentially tangled question of breakpoints in a new post, <a href="http://blog.cloudfour.com/how-do-you-pick-responsive-images-breakpoints/">So How do You Pick Responsive Images Breakpoints</a>?</p>
<p>To simplify what can be a very complex question, Grigsby ignores some scenarios, including the so-called &#8220;<a href="http://www.webmonkey.com/2011/11/make-your-most-important-images-stay-that-way-with-responsive-images/">art direction</a>&#8221; use case where images are optimized (cropped differently, for example) for different screens. Instead Grigsby focuses on the question of how to best select &#8220;different image files with different resolutions of the same image based on the screen size.&#8221; </p>
<p>The simplest solution is to just make your image and responsive design breakpoints the same, but that&#8217;s rarely going to be ideal for your site&#8217;s visitors. Here&#8217;s what Grigsby has to say about using the same breakpoints for both image and media queries:</p>
<blockquote>
<p>If we were talking about the art direction use case, then it is likely that the breakpoints would be the same because changes in the layout might also indicate an edit to the image.</p>
<p>But in the case where we’re simply changing files to provide different resolutions and a faster download, the image breakpoints should be determined based on when the browser is downloading an unnecessarily large file.</p>
</blockquote>
<p>The main problem is, what constitutes an &#8220;unnecessarily large file&#8221;? But even if you answer that, as Grigsby writes, you still haven&#8217;t answered every question:</p>
<blockquote><p>
How do you determine what is an unnecessarily large file? Is that 1 byte? 10k? 20k?</p>
<p>And if you can answer that question, how do you determine the resolutions at which those file size jumps are going to occur? Depending on the content of an image and the compression algorithm used, images are likely to have different resolutions at which they experience significant changes in file size.
</p></blockquote>
<p>In the end Grigsby doesn&#8217;t yet have an answer to the question of how to handle responsive image breakpoints. And neither do I. There just isn&#8217;t an easy answer that will work for every project. My thinking, and what I&#8217;ve done on my own site, runs pretty much along the same lines of <a href="http://blog.cloudfour.com/how-do-you-pick-responsive-images-breakpoints/comment-page-1/#comment-14803">Eric Portis&#8217;s comment on Grigsby&#8217;s post</a>. If you&#8217;ve got ideas, head over to Cloud Four and let them know how you&#8217;re doing it.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/08/responsive-images/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>Browsers at Odds With Web Developers Over &#8216;Adaptive Images&#8217;</title>
        <link>http://www.webmonkey.com/2012/05/browsers-at-odds-with-web-developers-over-adaptive-images/</link>
        <comments>http://www.webmonkey.com/2012/05/browsers-at-odds-with-web-developers-over-adaptive-images/#comments</comments>
        <pubDate>Tue, 22 May 2012 17:22:20 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=56758</guid>
        		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[adaptive images]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/05/Adaptive-Images-w.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/05/Adaptive-Images-w.jpg" alt="Browsers at Odds With Web Developers Over &#8216;Adaptive Images&#8217;" /></div>The web has yet to produce an elegant way of serving small images to small screens and large ones to large screens. The problem, argues web developer Jason Grigsby, is that what web developers want to do is at odds with how web browsers handle images.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_56148" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg" alt="" title="Photo_AdobeShadow2012-03-01" width="580" height="328" class="size-full wp-image-56148" /></a><p class="wp-caption-text">So many screens, so few images (testing responsive sites with <a href='http://www.webmonkey.com/2012/03/adobe-shadow-simplifies-mobile-web-testing/'>Adobe Shadow</a>). <em>Photo: Adobe</em></p></div></p>
<p>The web design community continues to debate the merits and drawbacks of the WHATWG&#8217;s proposed adaptive images solution. </p>
<p>As we <a href="http://www.webmonkey.com/2012/05/ready-or-not-adaptive-image-solution-is-now-part-of-html/">reported last week</a>, a new <code>srcset</code> attribute has been added to the <code>&lt;img&gt;</code> element in the WHATWG&#8217;s HTML specification. The new attribute will allow developers to specify different sized images based on the user&#8217;s screen size. </p>
<p>The idea is to find a way to serve smaller images to devices that don&#8217;t need large images &#8212; saving precious bandwidth &#8212; while serving high-resolution images to screens that warrant them. And the WHATWG&#8217;s <code>srcset</code> attribute does solve some of the problems surrounding adaptive images, but it&#8217;s far from ideal.</p>
<p>Now developer Jason Grigsby argues that not only will the <code>srcset</code> solution not completely solve the problem, but the <a href="http://blog.cloudfour.com/the-real-conflict-behind-picture-and-srcset/">goal of adaptive images is fundamentally at odds with how web browsers currently handle images</a>. In other words, there currently is no way to solve the problem.</p>
<p>Adaptive images are at odds with how browsers handle images thanks to what&#8217;s known as a &#8220;lookahead pre-parser.&#8221; Browsers use lookahead pre-parsers to start downloading images as soon as possible (to speed page-load times), which means images are parsed and downloads started <em>before</em> the browser has determined the full page layout. </p>
<p>However, a truly useful adaptive image solution needs the browser to first determine the page layout and then determine which images to use.</p>
<p>Grigsby rightly calls it a chicken and egg dilemma. &#8220;How do we reconcile a pre-parser that wants to know which size image to download ahead of time with an image technique that wants to respond to its environment once the page layout has been calculated?&#8221;</p>
<p>Grigsby argues that the smart thing to do might be for browsers to eliminate pre-fetching:</p>
<blockquote>
<p>For existing web content, the lookahead pre-parser is undoubtedly the fastest way to render the page. But if web development moves towards responsive images as standard practice, then delaying the download of images until the proper size of the image in the layout can be determined may actually be faster than using the lookahead pre-parser. The difference in size between a retina image for iPad and an image used on a low resolution mobile phone is significant.</p>
</blockquote>
<p>That&#8217;s going to be a tough sell to browser makers right now. Browser makers are understandably loath to do anything that might slow down page-load times &#8212; even if that slow-down is temporary. </p>
<p>Other possible solutions Grigsby covers include progressive image formats (which suffer from similar chicken-and-egg dilemmas) and of course the <code>&lt;picture&gt;</code> element. The whole article is <a href="http://blog.cloudfour.com/the-real-conflict-behind-picture-and-srcset/">well worth a read</a> since it gets into more details about why all of these solutions are ultimately less than ideal.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/05/browsers-at-odds-with-web-developers-over-adaptive-images/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>Ready or Not, Adaptive-Image Solution Is Now Part of HTML</title>
        <link>http://www.webmonkey.com/2012/05/ready-or-not-adaptive-image-solution-is-now-part-of-html/</link>
        <comments>http://www.webmonkey.com/2012/05/ready-or-not-adaptive-image-solution-is-now-part-of-html/#comments</comments>
        <pubDate>Thu, 17 May 2012 17:00:25 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=56634</guid>
        		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/05/tablets-screens-w.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/05/tablets-screens-w.jpg" alt="Ready or Not, Adaptive-Image Solution Is Now Part of HTML" /></div>Don't make a web browser? Then you don't have a voice in the future of the web. That seemed to be the message from the WHATWG earlier this week, but fortunately for web developers things aren't really as bad as they may seem.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_56148" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/Photo_AdobeShadow2012-03-011.jpg" alt="" title="Photo_AdobeShadow2012-03-01" width="580" height="328" class="size-full wp-image-56148" /></a><p class="wp-caption-text">So many screens, so few images (testing responsive sites with <a href='http://www.webmonkey.com/2012/03/adobe-shadow-simplifies-mobile-web-testing/'>Adobe Shadow</a>). <em>Photo: Adobe</em>.</p></div></p>
<p>The web needs a more intelligent way to serve images.</p>
<p>No one wants to waste bandwidth sending large images over limited mobile pipes, but everyone wants images to look good on the myriad screens connecting to today&#8217;s web. Currently web authors use a <a href="http://www.webmonkey.com/2012/05/use-your-head-for-a-better-way-to-serve-images/">variety of hacks</a> to (incompletely) work around this problem, but to really solve it the web likely needs new tools. </p>
<p>Unfortunately, thanks to miscommunication between standards bodies, web developers and browser makers, instead of a solution to the image problem what developers got this week feels more like a slap in the face. Eventually an adaptive image solution will likely emerge, but the real lesson for many developers will be about how the standards process works and how they fit into it, if at all.</p>
<p>Webmonkey has previously looked at some proposed solutions to the adaptive image problem. Some very smart web developers came up with the idea of a <code>&lt;picture&gt;</code> element that works much like the current HTML <code>&lt;video&gt;</code> element. These developers thought they had the attention of the Web Hypertext Application Technology Working Group, better known as the WHATWG. Then, earlier this week, Edward O&#8217;Connor, Apple&#8217;s WHATWG representative, proposed another method of solving the problem, using a new <code>srcset</code> attribute on the <code>&lt;img&gt;</code> element. See our <a href="http://www.webmonkey.com/2012/05/use-your-head-for-a-better-way-to-serve-images/">earlier coverage</a> of the <code>srcset</code> attribute for a more detailed look at how it works and compares to the <code>&lt;picture&gt;</code> proposal.</p>
<p>What has web developers up in arms is that Ian Hickson, editor of the WHATWG spec (and better known as Hixie) has already added the <code>srcset</code> attribute to the WHATWG&#8217;s HTML draft spec, seemingly ignoring the months of effort that went into <code>&lt;picture&gt;</code>. Worse, members of the WHATWG apparently weren&#8217;t even aware that developers were putting forth the effort to come up with a solution via the <a href="http://www.w3.org/community/respimg/">Responsive Images community group</a>. Nor were concerns about the <code>srcset</code> syntax given much consideration. Hickson does address some objections to <code>srcset</code> in his <a href="http://lists.w3.org/Archives/Public/public-whatwg-archive/2012May/0247.html">message to the WHATWG</a>, but ends up dismissing most of them.</p>
<p>That doesn&#8217;t match up with how most people envision the web standards process. But as web developer and standards advocate Jeremy Keith <a href="http://adactio.com/journal/5474/">writes</a>, &#8220;this is exactly how the WHATWG is supposed to work. Use-cases are evaluated and whatever Hixie thinks is the best solution gets put in the spec, regardless of how popular or unpopular it is.&#8221;</p>
<p>In fact, think of the WHATWG as the source for initial, rapid development of new features. The group was started by browser makers because the W3C&#8217;s HTML Working Group (HTMLWG) moved too slowly. But if the WHATWG is the source of rapid development, the W3C is an effective check on that speed, ensuring that even those of us who don&#8217;t make web browsers still have a voice in the future of HTML. (see our earlier overview for more on the <a href="http://www.webmonkey.com/glossary/the-difference-between-the-whatwg-and-the-htmlwg/">history and differences between the HTML WG and the WHATWG</a>.)</p>
<p>While the HTML WG is also chaired by Hickson (a position he will soon step down from), it offers a much more democratic (and consequently slower) process and has overridden the WHATWG&#8217;s rash decisions in the past. For example the W3C <a href="http://www.webmonkey.com/2011/11/w3c-adds-time-element-back-to-html5/">added the time element back</a> after <a href="http://www.webmonkey.com/2011/10/html5-drops-the-time-element/">Hickson removed it from the WHATWG spec</a>. </p>
<p>Confused yet? It gets worse. The WHATWG is working on an ever-evolving standard, what it calls <a href="http://www.webmonkey.com/2011/01/meet-html-the-spec-formerly-known-as-html5/">a &#8220;living standard,&#8221;</a> which is different from &#8212; and may well diverge from &#8212; the <a href="http://www.webmonkey.com/2011/02/html5-will-be-done-in-2014-what-comes-next/">snapshot-based standards issued by the W3C</a>, like HTML5. In a comment on longtime web standards champion Jeffery Zeldman&#8217;s <a href="http://www.zeldman.com/2012/05/17/editor-vs-constituencies/">post on the matter</a>, Jeremy Keith writes, &#8220;I don&#8217;t mind if the srcset attribute is in the WHATWG HTML spec but not in the W3C HTML5 spec. If it works, it&#8217;ll end up in a future W3C version number.&#8221;</p>
<p>Implicit in Keith&#8217;s statement is that if the <code>srcset</code> attribute doesn&#8217;t end up working out it won&#8217;t be in HTML5.x and would likely just fade away like the blink tag, the applet tag and other HTML ideas tried and later discarded.</p>
<p>Which is another way of saying developers need not panic. Perhaps web developers don&#8217;t have a voice in the WHATWG simply because we&#8217;ve been using the wrong channels (W3C community groups don&#8217;t seem to be an effective means of communicating with standards bodies, in fact they seem more like <a href="http://i.imgur.com/PXY6u.jpg">this</a>.). If you&#8217;ve got ideas and would like a voice in the future of the web join the <a href="http://www.whatwg.org/mailing-list#standards">WHATWG mailing list</a> and login to the <a href="irc://irc.freenode.net/#whatwg">IRC channel</a>. Introduce yourself, learn the rules and contribute. </p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/05/ready-or-not-adaptive-image-solution-is-now-part-of-html/feed/</wfw:commentRss>
        <slash:comments>1</slash:comments>

        
    </item>
    
    <item>
        <title>Flickr Goes Big With Larger Images, Responsive Redesign</title>
        <link>http://www.webmonkey.com/2012/05/flickr-goes-big-with-larger-images-responsive-redesign/</link>
        <comments>http://www.webmonkey.com/2012/05/flickr-goes-big-with-larger-images-responsive-redesign/#comments</comments>
        <pubDate>Tue, 15 May 2012 18:22:52 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=56587</guid>
        		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/05/flickrbigger-200x100.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/05/flickrbigger.jpg" alt="Flickr Goes Big With Larger Images, Responsive Redesign" /></div>Flickr, the photo-sharing service that started them all, is teaching its competitors some new tricks with a redesign that takes a responsive approach to images, serving up bigger, better images across devices.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><div id="attachment_56591" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/05/flickrbigger.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/05/flickrbigger.jpg" alt="" title="flickrbigger" width="580" height="388" class="size-full wp-image-56591" /></a><p class="wp-caption-text">Flickr: now with bigger images and a (mostly) responsive design.</p></div>Flickr recently <a href="http://www.webmonkey.com/2012/05/flickr-when-it-comes-to-photos-bigger-is-better/">changed its &#8220;lightbox&#8221; photo pages</a> &#8212; the darker photo-friendly interface on the site &#8212; to display much larger photos. Now the grandfather of online photo-sharing sites is <a href="http://blog.flickr.net/en/2012/05/15/big-big-bigger-photos-on-the-photo-page/">rolling out a site-wide redesign</a> that uses the same big, beautiful images to put your photos front and center on every page.</p>
<p>The larger images in Flickr&#8217;s revamped photo pages put the emphasis where it belongs &#8212; on your photos. Peripheral information, like comments, maps, tags, set info and so on are still there, they&#8217;re just now (rightly) dwarfed by the actual image.</p>
<p>The result is a much more photo-centric site that does a nice job of differentiating itself from the current trend of low-res, filter-heavy photo0sharing services. </p>
<p>Web developers, take note: Flickr&#8217;s new layout isn&#8217;t just eye-catching, it&#8217;s also somewhat <a href="http://www.webmonkey.com/2012/01/building-a-responsive-future-friendly-web-for-everyone/">responsively designed</a> &#8212; adjusting to the myriad screens on the web today and displaying the best photo possible without clogging your tubes with huge photo downloads. Flickr does stop short of scaling pages down to phone-size screens &#8212; for which there is a separate mobile website &#8212; but it resizes nicely to handle tablets.</p>
<p>That&#8217;s right, Flickr is the latest (and perhaps the largest) website to embrace not just a mostly responsive design with a liquid layout and media queries, but also a responsive approach to images.</p>
<p>We&#8217;ve looked at <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">dozens of ways to handle images in a responsive design</a>, but Flickr has opted for a custom setup that uses a bit of server-side PHP and some JavaScript to serve images based on screen size. Flickr is also using a custom algorithm that takes the width and height of the screen into account and &#8220;will display content at a width that will best showcase the most common photo ratio, the 4:3.&#8221; </p>
<p>For more details on how Flickr is handling the responsive aspects of the new design, check out <a href="http://code.flickr.com/blog/2012/05/15/liquid-photo-page-layout/">the Flickr code blog</a>.</p>
<p>Developers working with the <a href="http://www.flickr.com/services/api/">Flickr API</a> should note that the new photo sizes are now available through the Flickr API if your app or website would also like to display larger images.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/05/flickr-goes-big-with-larger-images-responsive-redesign/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>Use Your &#8216;Head&#8217; For a Better Way to Serve Images</title>
        <link>http://www.webmonkey.com/2012/05/use-your-head-for-a-better-way-to-serve-images/</link>
        <comments>http://www.webmonkey.com/2012/05/use-your-head-for-a-better-way-to-serve-images/#comments</comments>
        <pubDate>Mon, 14 May 2012 18:08:48 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=56520</guid>
        		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[responsive images]]></category>
        <description><![CDATA[Serving the right image to the right screen can be tricky. Developers need to account for not just screen size, but available bandwidth as well. A new solution solves the problem with just a few lines of code, provided of course that browser makers accept it.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><div id="attachment_53661" class="wp-caption alignleft" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/01/tablets.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/01/tablets.jpg" alt="" title="tablets" width="580" height="434" class="size-full wp-image-53661" /></a><p class="wp-caption-text">A better way to serve responsive images. <em>Photo: Ariel Zambelich/Wired.com</em> <a href='http://creativecommons.org/licenses/by-nc/3.0/' ><img style='float:right;padding:0;' src='http://www.wired.com/about/wp-content/gallery/global/creative-commons.gif' class='creative-commons'></a></p></div>Responsive web design has grown well beyond its humble beginnings &#8212; using liquid layouts and media queries to scale websites so they fit any screen &#8212; and now means developers must wrestle with much more complex problems, like serving the right image to the right screen.</p>
<p>Mobile screens are small; downloading full-size images is a waste of bandwidth (and quite possibly users&#8217; money as bandwidth caps become more common). But serving tiny pixelated images to <a href="http://www.webmonkey.com/2012/03/the-web-needs-to-get-ready-for-the-the-high-resolution-future/">increasingly high-resolution screens</a> doesn&#8217;t help users either. There are already dozens of <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">creative solutions to the problem of handling images intelligently in responsive design</a>, but ultimately the web needs more than hacks; it needs a built-in responsive image solution.</p>
<p>The <a href="http://www.w3.org/community/respimg/">Responsive Images community group</a> has been wrestling with this problem for some time and has proposed and refined the <code>&lt;picture&gt;</code> tag, one possible solution. The picture element would work much like the HTML5 <code>&lt;video&gt;</code> tag, with code that looks something like this:</p>
</p>
<pre class="brush: js">
<picture alt="image description">
<source src="mobile.jpg" /> <!-- Matches by default -->
<source src="high-res.jpg" media="min-width: 800px" /> <!-- Avoids duplicate load by overriding previous request. -->
<img src="mobile.jpg" /> <!-- Fallback -->
</picture>
</pre>
<p>Due to a communication breakdown between the WHAT WG, which actually writes the standards, and the community group, which is a way for outsiders to contribute to standards, the WHAT WG is already considering  <a href="http://www.w3.org/community/respimg/2012/05/11/respimg-proposal/">a different proposed solution</a> that involves adding some elements to the good old <code>&lt;img&gt;</code> tag.</p>
<p>The proposed solution comes from Apple&#8217;s Edward O’Connor and mirrors <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-May/035746.html">a similar syntax for background images in CSS</a>. Neither are standards yet and we&#8217;re hoping neither ever become standards. Here&#8217;s an example of the proposed syntax:</p>
<pre class="brush: js">
&lt;img src="face-600-200@1.jpeg" alt=""
set="face-600-200@1.jpeg 600w 200h 1x,
face-600-200@2.jpeg 600w 200h 2x,
face-icon.png       200w 200h"&gt;
</pre>
<p>That&#8217;s a code tangle only a browser maker could love and in the subsequent discussion on the community group post developers are nearly unanimous in preferring the <code>&lt;picture&gt;</code> tag (though many dislike its verboseness). The truth is neither this nor the  <code>&lt;picture&gt;</code> tag is a very appealing solutions.</p>
<p>However, toward the bottom of that discussion thread Denis Leblanc proposes another possible solution, namely, header tags. Matt Wilcox, who created the <a href="http://www.webmonkey.com/2011/08/speed-up-your-responsive-designs-with-adaptive-images/">Adaptive Images solution</a> we&#8217;ve covered before, takes Leblanc&#8217;s idea and <a href="http://www.w3.org/community/respimg/2012/05/13/an-alternative-proposition-to-and-srcset-with-wider-scope/">runs with it in another post</a>. What Leblanc proposes is creating a new head tag that would allow web developers to create breakpoints with a media-query-like syntax:</p>
<pre class="brush: js">
&lt;head&gt;
&lt;meta name='case' data='breakpoint1' media='min-width:350px' /&gt;
&lt;meta name='case' data='breakpoint2' media='min-width:1000px' /&gt;
&lt;/head&gt;
</pre>
<p>Here&#8217;s Wilcox&#8217;s explanation of how it would work:</p>
<blockquote>
<p>What the code above does is set &#8220;case&#8221; to equal a particular value, when a media query expression is matched. And if that&#8217;s done in the HTML <code>&lt;head&gt;</code> we know that absolutely everything else can rely on it &#8212; the <code>&lt;head&gt;</code> is the very first thing parsed by a browser, even before anything inside <code>&lt;body&gt;</code>. Anyone familiar with working on the ‘responsive images’ problem should at this point be getting very excited. It means that the browser can be aware of the need to adapt before any pre-fetch behaviours have been triggered by finding an <code>&lt;img /&gt;</code> element in the mark-up. That is a major advantage and is how this solution solves the problem of image pre-fetch.</p>
</blockquote>
<p>In other words, this solution neatly avoids downloading anything other than only the image needed, saving bandwidth and processing power. Then in your body you would simply write:</p>
<pre class="brush: js">
&lt;img src='/content/images/{case}/photo.jpg' alt='' /&gt;
</pre>
<p>It&#8217;s certainly less verbose than either of the other proposals, needing only a single image element with no custom properties or other code. It&#8217;s also backward-compatible provided you either create a directory called &#8220;{case}&#8221; on your server or alias the path to an existing file. Browsers that don&#8217;t understand the syntax simply serve the image referenced and those that do choose the appropriate image from the meta tag breakpoints you&#8217;ve set. </p>
<p>In short, this looks like a very ideal solution from a web author&#8217;s point of view. Whether or not browser makers and the standards bodies agree remains to be seen. One possible strike against it is that it would add variables to HTML in the form of the {case} syntax, but variables are already part of CSS and JavaScript, so why not HTML?</p>
<p>None of these proposals is anything more than an idea at this stage &#8212; though there is already a <a href="http://pci.github.com/metavar_polyfill/">JavaScript polyfill</a> for the new head tag idea &#8212; but if you&#8217;d like to keep up with what&#8217;s happening, be sure to keep an eye on the W3C&#8217;s <a href="http://www.w3.org/community/respimg/">Responsive Images community group</a>. It&#8217;s not going to happen overnight, but eventually standards bodies and browser makers are going to start implementing solutions and the more experimenting web developers have done, the better those solutions will be. It&#8217;s your web after all, so make it better.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/05/use-your-head-for-a-better-way-to-serve-images/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>JavaScript Package Offers a Smarter Way to Serve Hi-Res Images</title>
        <link>http://www.webmonkey.com/2012/04/a-smarter-way-to-serve-high-resolution-images/</link>
        <comments>http://www.webmonkey.com/2012/04/a-smarter-way-to-serve-high-resolution-images/#comments</comments>
        <pubDate>Fri, 20 Apr 2012 17:19:42 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=55771</guid>
        		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/04/ipadhighres-200x100.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/ipadhighres.jpg" alt="JavaScript Package Offers a Smarter Way to Serve Hi-Res Images" /></div>The rise of mobile devices means a return to limited bandwidth, but also gorgeous, high-res displays. Better screens connected to skinnier pipes makes serving images on the web more complicated, but fortunately Foresight.js offers a very clever solution.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><div id="attachment_55791" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/03/120316-NEW-IPAD-002edit.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/04/ipadhighres.jpg" alt="" title="ipadhighres" width="580" height="387" class="size-full wp-image-55791" /></a><p class="wp-caption-text">The high-resolution web is coming. <em>Photo: Ariel Zambelich/Wired</em> <a href='http://creativecommons.org/licenses/by-nc/3.0/' class='border:none; outline:none;'> <img src='http://www.wired.com/about/wp-content/gallery/global/creative-commons.gif' class='creative-commons'> </a></em></p></div></p>
<p>Given enough time, all simple, already solved problems of the web eventually rear their ugly heads again.</p>
<p>Remember when limited bandwidth was a huge problem? Then bandwidth was infinite. Now it&#8217;s a problem again. And that means serving up images is once again a complex problem with no elegant solution. Its seems simple. Websites should serve the right image to the right screen, high-resolution images to high-resolution devices and low res to the rest. But of course it&#8217;s not that simple. Factors like bandwidth as well as screen size and orientation complicate the matter considerably. </p>
<p>Arguably the best solution right now is to send low-res images to every device. Sure, your images might look terrible on high-res screens, but at least you aren&#8217;t wasting people&#8217;s time or worse, costing them money.</p>
<p>While that&#8217;s the safest solution for now, the web doesn&#8217;t get better if no one takes any risks. Fortunately, until some standard or best practice emerges, we&#8217;ll likely continue to see developers pushing the boundaries and discovering new ways to handle the seemingly simple task of serving the appropriate image to the appropriate device.</p>
<p>The latest image cleverness we&#8217;ve seen is Adam Bradley&#8217;s <a href="https://github.com/adamdbradley/foresight.js">Foresight.js</a>. Foresight.js is designed to make it easy to serve up high-resolution images to devices like the new iPad, but what sets foresight.js apart from half a dozen other solutions that do the same thing is that it not only checks for a hi-res screen, but also checks to see if the device currently has a fast enough network connection for larger images. If, and only if, your visitor has both a device capable of displaying high-res images and a network connection fast enough to handle the larger file size, are larger images served.</p>
<p>Part of what makes Foresight.js appealing is its use of the <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/1103.html">proposed CSS image-set() function</a>, one possible solution to the problem of serving up the right image at the right time. The image-set() function, which works in WebKit nightly builds and is under consideration by the W3C, looks like this:</p>
<pre class="brush: js">
myselector {
    background: image-set(url(foo-lowres.png) 1x, url(foo-highres.png) 2x) center;
}
</pre>
<p>Foresight.js takes the image-set() proposal and uses an ingenious hack to make it work in other browsers: the font-family property. Yes, it sounds crazy. But it works and remains technically valid CSS because font-family allows for arbitrary strings (to handle font names). That means browsers have no problem with a rule like this:</p>
<pre class="brush: js">
myselector {
    font-family: ' image-set( url(/images/foo.png), url(/images/foo_2x.png) 2x high-bandwidth ) ';
}
</pre>
<p>It&#8217;s a hack to be sure, but it&#8217;s our favorite kind of hack: clever and functional. Because browsers successfully parse the font-family rule (even if they can&#8217;t apply it) the value is added to the DOM and JavaScript has no problem accessing it, which is exactly what foresight.js does.</p>
<p>For more on foresight.js, head over to the GitHub page which as links to plenty of examples uses and copious documentation on the script&#8217;s many tricks. Also be sure to read through Bradley&#8217;s <a href="https://github.com/adamdbradley/foresight.js/wiki/Challenges-for-High-Resolution-Images">Challenges for High Resolution Images</a>, which offers some background on foresight.js and the design decisions he made.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/04/a-smarter-way-to-serve-high-resolution-images/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    
    <item>
        <title>The Web Needs to Get Ready for the High-Resolution Future</title>
        <link>http://www.webmonkey.com/2012/03/the-web-needs-to-get-ready-for-the-the-high-resolution-future/</link>
        <comments>http://www.webmonkey.com/2012/03/the-web-needs-to-get-ready-for-the-the-high-resolution-future/#comments</comments>
        <pubDate>Fri, 23 Mar 2012 18:46:29 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=55152</guid>
        		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Web Basics]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[high-res]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/03/120316-NEW-IPAD-002edit-200x100.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/03/120316-NEW-IPAD-002edit-660x440.jpg" alt="The Web Needs to Get Ready for the High-Resolution Future" /></div>The new iPad is just the first in a coming tidal wave of high-resolution screens. Today we have hacks, but what the web needs are new standards and new tools to make sure developers are ready for the high-resolution future.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><a href="http://www.webmonkey.com/wp-content/uploads/2012/03/120316-NEW-IPAD-002edit.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/03/120316-NEW-IPAD-002edit-1024x682.jpg" alt="" title="120316-NEW-IPAD-002edit" width="660" class="size-large wp-image-55191" /></a></p>
<p>The high-resolution retina display iPad has one downside &#8212; normal resolution images look <em>worse</em> than on lower resolution displays. On the web that means that text looks just fine, as does any CSS-based art, but photographs look worse, sometimes even when they&#8217;re actually high-resolution images.</p>
<p>Pro photographer Duncan Davidson was <a href="http://duncandavidson.com/blog/2012/03/webkit_retina_bug">experimenting with serving high-resolution images to the iPad 3</a> when he ran up against what seemed to be a limit to the resolution of JPG images in WebKit. Serving small high-resolution images &#8212; in the sub-2000px range &#8212; works great, but replacing 1000px wide photographs with 2000px wide photos actually looks worse due to downsampling.</p>
<p>The solution (turns out) is to go back to something you probably haven&#8217;t used in quite a while &#8212; progressive JPGs. It&#8217;s a clever solution to a little quirk in <a href="http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/">Mobile Safari&#8217;s resource limitations</a>. Read Davidson&#8217;s <a href="http://duncandavidson.com/blog/2012/03/photography_on_retina">follow-up post</a> for more details, and be sure to look at the example image if you&#8217;ve got a new iPad because more than just a clever solution, this is what the future of images on web will look like.</p>
<p>As Davidson says:</p>
<blockquote>
<p>For the first time, I&#8217;m looking at a photograph I&#8217;ve made on a screen that has the same sort of visceral appeal as a print. Or maybe a transparency laying on a lightbox. Ok, maybe not quite that good, but it’s pretty incredible. In fact, I really shouldn&#8217;t be comparing it to a print or a transparency at all. Really, it&#8217;s its own very unique experience.</p>
</blockquote>
<p>To show off the sample on his site Davidson uses a bit of JavaScript to toggle the high- and low-res images, highlighting the difference.</p>
<p>But how could you go about serving the higher res image to just those screens with high enough resolution and fast enough connections to warrant it? </p>
<p>You can&#8217;t.</p>
<p>So what&#8217;s a web developer with high-res images to show off supposed to do? Well, right now you&#8217;re going to have to decide between all or nothing. Or you can use a hack like one of the less-than-ideal <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">responsive image solutions we&#8217;ve covered before</a>.</p>
<p>Right now visitors with the new iPad are probably a minority for most websites, so not that many people will be affected by low-res or poorly rendered high-res images. But Microsoft is already <a href="http://blogs.msdn.com/b/b8/archive/2012/03/21/scaling-to-different-screens.aspx">prepping Windows 8 for high-res retina-style screens</a> and Apple is getting ready to <a href="http://arstechnica.com/apple/news/2012/03/signs-in-mountain-lion-point-to-retina-display-coming-this-summer.ars">bring the same concept to laptops</a>.</p>
<p>The high-res future is coming fast and the web needs to evolve just as fast.</p>
<p>In the long run that means the web is going to need <a href="http://www.w3.org/community/respimg/">a real responsive image solution</a>; something that&#8217;s part of HTML itself. An new HTML element like <a href="http://www.w3.org/community/respimg/2012/02/21/a-sample-picture-implementation/">the proposed <code>&lt;picture&gt;</code> tag</a> is one possible solution. The picture element would work much like the video tag, with code that looks something like this:</p>
<p>
<pre class="brush: js">
<picture alt="image description"> 
<source src="mobile.jpg" /> <!-- Matches by default --> 
<source src="high-res.jpg" media="min-width: 800px" /> <!-- Avoids duplicate load by overriding previous request. --> 
<img src="mobile.jpg" /> <!-- Fallback -->

</picture>

</pre>
</p>
<p>The browser uses this code to choose which image to load based on the current screen width. </p>
<p>The picture element would solve one part of the larger problem, namely serving the appropriate image to the appropriate screen resolution. But screen size isn&#8217;t the only consideration; we also need a way to measure the bandwidth available. </p>
<p>At home on my Wi-Fi connection I&#8217;d love to get Davidson&#8217;s high-res images on my iPad. When I&#8217;m out and about using a 3G connection it would be better to skip that extra overhead in favor of faster page load times.</p>
<p>Ideally browsers would send more information about the user’s environment along with each HTTP request. Think screen size, pixel density and network connection speed. Developers could then use that information to make a better-informed guess about which images it to serve. Unfortunately, it seems unlikely we&#8217;ll get such tools standardized and widely supported before the high-res world overtakes the web. With any server-side solution to the bandwidth problem still far off on the horizon, <a href="http://davidbcalhoun.com/2010/using-navigator-connection-android">navigator.connection</a> will become even more valuable in the mean time.</p>
<p>Further complicating the problem are two additional factors, data caps on mobile connections and technologies like Apple&#8217;s <a href="http://www.apple.com/itunes/airplay/">AirPlay</a>. The former means that even if I have a fast LTE connection and a high-resolution screen I still might not want to use my limited data allotment to download high-res images. </p>
<p>AirPlay means I can browse to a site with my phone &#8212; which would likely trigger smaller images and videos since it&#8217;s a smaller screen &#8212; but then project the result on a huge HD TV screen. This is not even a hypothetical problem, you can <a href="http://cvil.ly/2012/02/20/why-airplay-just-wrecked-your-responsive-media-strategy/">experience it today with PBS&#8217;s iPhone app and AirPlay</a>.</p>
<p>Want to help figure out how the web needs to evolve and what new tools we&#8217;re going to need? Keep an eye on the W3C&#8217;s <a href="http://www.w3.org/community/respimg/">Responsive Images community group</a>, join the mailing list and don&#8217;t be shy about contributing. Post your experiments on the web and document your findings like Davidson and countless others are already doing.</p>
<p> It&#8217;s not going to happen overnight, but eventually the standards bodies and the browser makers are going to start implementing solutions and the more test cases that are out there, the more experimenting web developers have done, the better those solutions will be. It&#8217;s your web after all, so make it better.</p>
<p>Photo: Ariel Zambelich/Wired  <a href='http://www.wired.com/about/#faq13' class='border:none; outline:none;'><img src='http://www.wired.com/about/wp-content/gallery/global/creative-commons-ng.gif' class='creative-commons'></a></p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/03/the-web-needs-to-get-ready-for-the-the-high-resolution-future/feed/</wfw:commentRss>
        <slash:comments>2</slash:comments>

        
    </item>
    
    <item>
        <title>What the New iPad&#8217;s Retina Display Means for Web Developers</title>
        <link>http://www.webmonkey.com/2012/03/what-the-new-ipads-retina-display-means-for-web-developers/</link>
        <comments>http://www.webmonkey.com/2012/03/what-the-new-ipads-retina-display-means-for-web-developers/#comments</comments>
        <pubDate>Wed, 14 Mar 2012 20:12:16 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=55021</guid>
        		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[UI/UX]]></category>
		<category><![CDATA[Visual Design]]></category>
		<category><![CDATA[Web Basics]]></category>
		<category><![CDATA[responsive design]]></category>
		<category><![CDATA[responsive images]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/03/retinascreen-200x100.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/03/retinascreen.jpg" alt="What the New iPad&#8217;s Retina Display Means for Web Developers" /></div>The high-res future will get a little closer this Friday when Apple ships its new iPad. Just as the advent of HD TVs required makeup artists to rethink their craft, the new iPad marks the beginning of a high-res web where developers will need to rethink how they deliver graphics and images.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><div id="attachment_55043" class="wp-caption aligncenter" style="width: 590px"><img src="http://www.webmonkey.com/wp-content/uploads/2012/03/retinascreen.jpg" alt="" title="retinascreen" width="580" height="323" class="size-full wp-image-55043" /><p class="wp-caption-text">The high-res future is coming</p></div>The first of the new iPads will arrive in the hands of the public this Friday, March 16. Like the iPhone before it, and no doubt many more devices to come after it, the new iPad has four times the resolution of typical screens. That means your visitors will soon be looking at your site on a high-resolution screen with a whopping 3.1 million pixels. </p>
<p>The sharp, crystal-clear screens are awesome news for new iPad owners, but they create some new dilemmas for web developers who&#8217;d like to offer a better experience for high-resolution screens. Sure, increased pixel density means you can serve up sharper, better looking graphics, but there is a cost as well &#8212; bigger images mean more bandwidth and longer page loads. </p>
<p>This isn&#8217;t a new problem by any means and Webmonkey has looked at a variety of solutions in the past, including techniques like <a href="http://www.webmonkey.com/2011/08/speed-up-your-responsive-designs-with-adaptive-images/">adaptive images</a> and <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">responsive images</a>. </p>
<p>The problem is simple: you need to send smaller images to small screens and larger images to larger screens. Sending a huge iPad-optimized image to a device with a max resolution of 320&#215;480 just doesn&#8217;t make sense. At the same time, when bandwidth isn&#8217;t an issue, most sites will want to serve high-resolution content to displays that can handle it. </p>
<p>The ideal solution would be to detect both the resolution of the screen and the available bandwidth. Then, based on the combination of those two factors, the server could offer up the appropriate image. Currently that&#8217;s not possible, though there are already <a href="http://www.alistapart.com/articles/responsive-images-how-they-almost-worked-and-what-we-need/">proposals to extend HTML to handle that scenario</a>.</p>
<p>The <a href="http://www.w3.org/community/respimg/">Responsive Image Working Group</a> is a W3C community group hoping to solve some of these problems. The group is proposing a new HTML element, <code>&lt;picture&gt;</code>, which will take into account factors like network speed, device dimensions, screen pixel density and browser cache to figure out which image to serve up. Think of it as a much smarter version of the old <a href="http://www.w3schools.com/jsref/prop_img_lowsrc.asp">lowsrc property</a>. So far though it&#8217;s all hypothetical</p>
<p>In the mean time if you&#8217;d like to serve up high resolution images to your third-generation iPad visitors look no further than Apple.com for one (not necessarily ideal) way to do it. An Apple Insider reader noticed that <a href="http://www.appleinsider.com/articles/12/03/13/applecom_upgrading_to_high_resolution_images_ahead_of_retina_ipad_launch.html">Apple is already prepping its site to deliver double-resolution images</a> to new iPads. Cloud Four&#8217;s Jason Grigsby, whose <a href="http://www.webmonkey.com/2011/09/the-current-state-of-responsive-images/">responsive image research we&#8217;ve covered before</a>, has <a href="http://cloudfour.com/how-apple-com-will-serve-retina-images-to-new-ipads/">a great breakdown of what Apple is doing</a>.</p>
<p>Essentially Apple is serving up lower resolution images by default, then using JavaScript to send larger images on to iPads. That works, but it will definitely mean increased download times for new iPads since they have to download two files for every graphic. Apple&#8217;s approach will also up the number of HTTP requests, which will also slow down the page.</p>
<p>The slower page loads seem to be an acceptable trade off for Apple since the company no doubt wants to showcase the new iPad&#8217;s high resolution display with high resolution images. For other sites the bandwidth trade off may not be worth the gain in image resolution.</p>
<p>Still, screens are only going to continue getting better with ever-increasing pixel density. Now is the time, if you haven&#8217;t already, to start embracing CSS 3 (avoid images altogether with gradients, shadows and rounded corners in CSS 3), Scalable Vector Graphics (SVG) for resolution independent graphics and of course @media queries to serve high-res background images.</p>
<p>For more on detecting and developing for high resolution displays, check out these posts from around the web:</p>
<ul>
<li><a href="http://timkadlec.com/2012/02/media-query-asset-downloading-tests/">Media Query &amp; Asset Downloading Tests</a> &#8212; Want to know how you can avoid the double image load tax Apple is paying? Tim Kadlec has the tests and results for a variety of methods.</li>
<li><a href="http://menacingcloud.com/?c=highPixelDensityDisplays">Optimising for High Pixel Density Displays.</a> &#8212; Menacing Cloud&#8217;s take on optimizing for the iPhone 4 retina display.</li>
<li><a href="http://bradbirdsall.com/mobile-web-in-high-resolution">Mobile Web in High Resolution</a> &#8212; Brad Birdsall&#8217;s take on bringing half pixel borders to high resolution devices</li>
<li><a href="http://coding.smashingmagazine.com/2012/01/16/resolution-independence-with-svg/">Resolution Independence With SVG</a> &#8212; David Bushell tackles SVG over at Smashing Magazine. </li>
<li><a href="http://www.brucelawson.co.uk/2011/notes-on-adaptive-images-yet-again/">Notes on Adaptive Images (yet again!)</a> &#8212; Opera&#8217;s Bruce Lawson rounds up problems and solutions facing anyone trying to serve up different images based on screen size.</li>
</ul>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/03/what-the-new-ipads-retina-display-means-for-web-developers/feed/</wfw:commentRss>
        <slash:comments>5</slash:comments>

        
    </item>
    </channel>
</rss>