W3C home > Mailing lists > Public > www-style@w3.org > May 2011

Re: [css3-images] What does image-resolution apply to?

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 24 May 2011 11:07:02 -0700
Message-Id: <A53C8B65-B6ED-42B5-9372-0E3E6A537499@gmail.com>
Cc: Alan Gresley <alan@css-class.com>, www-style list <www-style@w3.org>, MURAKAMI Shinyu <murakami@antenna.co.jp>
To: "Tab Atkins Jr." <jackalmage@gmail.com>


On May 24, 2011, at 10:46 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Tue, May 24, 2011 at 10:38 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On May 24, 2011, at 10:23 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>>> On Tue, May 24, 2011 at 9:58 AM, Alan Gresley <alan@css-class.com> wrote:
>>>> On 25/05/2011 2:42 AM, Tab Atkins Jr. wrote:
>>>>> On Tue, May 24, 2011 at 7:24 AM, Brad Kemper<brad.kemper@gmail.com>
>>>>>> This is also a question about background size. Suppose that with
>>>>>> that same 400 x 400 raster image I have { background-image:
>>>>>> image('400x400.png' 10dpi); background-size: 1in 1in; }? What are
>>>>>> the final sizes of the rendered image pixels? 1/10" or 1/400"?
>>>>>> 
>>>>>> Perhaps in both cases, you are just adjusting a sort of "late
>>>>>> intrinsic" resolution that is then overridden by width and height
>>>>>> declarations? If so, I think you need to say so. (Apologies, if you
>>>>>> do somewhere already, and I just missed it.)
>>>>> 
>>>>> I don't think it's clearly stated how this works, so I should fix
>>>>> that.  The intent is that it affects the intrinsic size.
>>>>> 
>>>>> So, in your first example (400x400 pixel image at 72dpi, sized to
>>>>> 1in by 1in), you first apply the resolution.  This gives you a
>>>>> native image size of 533px (or 5.55in), which is then scaled down to
>>>>> 1in by 1in.  Your second example is similar, though more extreme
>>>>> given the tiny dpi.
>>>> 
>>>> What happens with a SVG background-image that has no intrinsic size or no
>>>> dimension?
>>>> 
>>>> background-image: image('basic.svg' 50dpi)
>>> 
>>> For vector images, the "dot" in dpi is pixels in the outermost
>>> coordinate space.  So, that declaration simply means that the SVG's
>>> initial coordinate space is such that 1px in it is equal to 1/50th of
>>> an inch.
>>> 
>>> In other words, if the SVG image had something like "<svg width='100'
>>> height='100'>" as the root element, then it would be scaled to be a
>>> 2in by 2in square.  Without that resolution declaration, the image
>>> would be just over 1in square instead.
>> 
>> Are SVG lengths alway unitless numbers? If not, I would expect an SVG measured in inches to be pixelated if given a low enough resolution (which might occasionally be a useful effect).  Forgive my ignorance of SVG, please.
> 
> No, they can be given as actual lengths, like "1in".  I'm not
> immediately certain how that would interact with resolution changes,
> though.  I suspect that's far enough down the unspecified road that
> it's up to the UA right now.

That should be specified then, in your images module. Either SVG should be resolution-independant (using e resolution), or it can be locked down via a <resolution> value. I don't feel strongly one way or another, but it should be consistent. 

Probably 'filter()' would be a better way of pixelating as a special effect. 
Received on Tuesday, 24 May 2011 18:07:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:40 GMT