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

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

From: Simon Sapin <simon.sapin@exyr.org>
Date: Sat, 27 Jul 2013 01:07:23 +0100
Message-ID: <51F30F3B.8050307@exyr.org>
To: liam@w3.org
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Le 26/07/2013 19:36, Liam R E Quin a écrit :
> 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.

This seems like a convoluted way of saying than we should support two 
different X / Y values, which I agree is the right thing to do. (Whether 
there is one or more intermediate re-sampling is an implementation details.)

But given that the less-complex version of this property is already 
at-risk, I was also suggesting a fallback plan in case some implementers 
reject the additional complexity.


> 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.

Earlier I missed that PNG supports resolution metadata at all because it 
doesn’t use that name, but yes, that should be supported as well.


-- 
Simon Sapin
Received on Saturday, 27 July 2013 00:07:48 UTC

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