W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] <img srcset> for responsive bitmapped content images

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 10 May 2012 16:19:13 +0200
Message-ID: <CAAWBYDAV_CiryQ+CJqHujg1ihatStdUP8zMZY_pBMUX-UAun9Q@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: whatwg@whatwg.org, Edward O'Connor <eoconnor@apple.com>
On Thu, May 10, 2012 at 3:47 PM, Simon Pieters <simonp@opera.com> wrote:
> On Thu, 10 May 2012 15:24:28 +0200, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>> CSS3 Images has the image-resolution property, which lets you tell the
>> browser what resolution to display the image at (that is, how it
>> should determine the automatic size).  You can say "image-resolution:
>> from-image;" to get it to use the image's native resolution, whatever
>> it is.  So, we need to add a rule to the UA stylesheet that says
>> "img[srcset] { image-resolution: from-image; }".
> Do we want from-image here? Or do authors prefer to serve 96dpi images that
> are bigger, and specify the intended dpi in the markup?

Can you clarify what you mean by this?  Do you mean serving a 10inch
wide image at 96dpi rather than a 5inch wide image at 192dpi, and then
telling the browser to scale it by the x factor?

The two are identical in the image's data (they're all 960 pixels
wide), only the metadata differs.

I suspect both:
1. A lot of authors would find it very confusing if they couldn't save
an image at 300dpi and have it just work, and
2. A lot of authors will be confused to discover that that they have
to save their image as 300dpi to get it to work.

>> For two, I'm not sure that it's particularly obvious that when you say
>> "2x", you should make sure your image was saved as 196dpi.  You have
>> to already know what the default resolution is.  As well, I think that
>> values like 300dpi are pretty common, and they don't map to integral
>> 'x' values.  If people say "screw it" and use "3x", this'll be
>> slightly wrong and I think will cause ugly blurring.  If we make this
>> take <resolution>, people can just use the dpi unit.
> Can we just use CSS's 'dpi' instead?
> <img src="default.jpg" srcset="highres.jpg 300dpi">

If you take dpi, you might as well take all of the <resolution> units.
 There's only 3 so far - dpi, dpcm, and dppx.  There's no good reason
to limit to only one of them, since they're all constant multiples of
each other.

Received on Thursday, 10 May 2012 14:20:07 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:42 UTC