Re: Border-Images and 'round': CSS Backgrounds and Borders Module Level 3

fantasai kirjoitti:
> Brad Kemper wrote:
>> fantasai wrote:
>>> http://dev.w3.org/cvsweb/csswg/css3-background/Overview.src.html.diff?r1=1.167&r2=1.168&f=h 
>>
>> Those look like all good changes to me
> 
> Bert responded on IRC:
> <Bert> B.t.w, fantasai, I don't think your latest edit to Backgrounds is
>   correct. ceil() is better than round(), bcause it creates fewer raster
>   artifacts. Moreover, you introduced a risk of incompatibility by allowing
>   UAs to use different algorithms in unspecified cases.
> 
> I think it's a good point about the incompatibility, but I also think
> it makes sense to use round() in the cases where there's no problem
> with raster artifacts. Vector images and images with sufficiently
> high resolution are such cases. At the very least we should allow this
> for vectors.

As far as I know, the spec does not specify the scaling method 
(bilinear, bicubic, something else?) either. As a result you already 
have "incompatibility". I think it would make sense to allow user agents 
to compete with rendering quality here.

As you say, it makes sense to allow this for "high" resolution source 
images. I think that the spec cannot specify reasonable exact limit for 
changing from real rounding to ceil() method without knowing the scaling 
algorithm.

> How about I tighten up the text to use round() normally, but require
> ceil() when there's a raster image with insufficient resolution?
> Something like this?
>   
> http://dev.w3.org/cvsweb/csswg/css3-background/Overview.src.html.diff?r1=1.172&r2=1.173&f=h 
> 
> (I'm not sure if I should replace "device pixel" there with "1px".)

This change specifies an exact limit and I think it should not do that 
for the reasons stated above. For example, imagine a source image 500px 
wide that is used to cover 1020px length ("round"). The suggested spec 
says that it MUST be rendered with three repeations. A high quality 
scaler could easily render the result with only two repeations and the 
result would match the source image much more closely (therefore I would 
say that this representation would be of "higher quality").

Can you provide an example where you think that the resulting 
incompatiblity between user agents that use round() instead of ceil() 
would make a difference? I understand that such user agents would repeat 
the border image different number of times but why would that matter?

-- 
Mikko

Received on Thursday, 1 October 2009 07:11:22 UTC