W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css3-images] 'image-resolution: from-image' based on resolution X / Y

From: Liam R E Quin <liam@w3.org>
Date: Fri, 26 Jul 2013 14:36:08 -0400
Message-ID: <1374863768.15669.752.camel@localhost>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Simon Sapin <simon.sapin@exyr.org>, www-style list <www-style@w3.org>
On Fri, 2013-07-26 at 09:52 -0700, Tab Atkins Jr. wrote:
> On Fri, Jul 26, 2013 at 9:43 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> > I’m in favor of allowing two values (including specifying two in CSS.) If
> > the WG rejects that, use the horizontal one.

If you use the horizontal one and ignore the vertical you'll get an
image that appears "stretched" and pixelated vertically.

Correct would be to scale (resample) the image.

E.g. if you have an image that's 300dpi horizontally and 200 dpi
vertically, e.g from a fax machine, and it's 600 x 400 pixels, it should
be displayed as a 2inch square. An implementation could do this by
scaling it down to 400x400 pixels and then using 400dpi as the
resolution, or by scaling it up to 600x600 pixels and using 300dpi.

A print implementation can just pass on the differing values to the
renderer, which can quite likely handle this case as input to the
screening algorithm, or can use a transform without resampling.

Of course if no-one actually has any of these hypothetical images it
doesn't really matter. I've seen them from time to time - I suspect
they're not used on the Web much because browsers don't handle them.

PNG can also have differing X and Y resolutions, by the way, which I've
only really encountered after making a mistake with a scanner.

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Received on Friday, 26 July 2013 18:36:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC