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

Re: [css-shapes] shape-image-threshold should be clearer about >= vs >

From: Brad Kemper <brad.kemper@gmail.com>
Date: Thu, 12 Sep 2013 07:45:02 -0700
Message-Id: <85D3BAD6-0B07-4406-93E0-56A142A64FBA@gmail.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
To: Alan Stearns <stearns@adobe.com>
On Sep 11, 2013, at 2:23 PM, Alan Stearns <stearns@adobe.com> wrote:

> On 9/11/13 8:03 PM, "Brad Kemper" <brad.kemper@gmail.com> wrote:
> 
>> On Sep 11, 2013, at 8:43 AM, Alan Stearns <stearns@adobe.com> wrote:
>> 
>>> The intended behavior is for the 0.0 initial value to enclose all of the
>>> pixels that are not fully transparent. I want that to be the behavior of
>>> the initial value, and I don't think picking an arbitrary amount of
>>> decimals for a 0.0001 initial value is a good idea.
>> 
>> Wouldn't 0.5 be a better default? Especially since when manually editing
>> alpha masks it is easy to accidentally end up with a few stray pixels
>> that are not fully transparent, against a field of other pixels that are.
> 
> Is it likely those stray pixels would be under a 0.5 threshold?

If I am manually creating a mask using a paintbrush, it is hard to see the difference between white and almost white, or between black and almost black. So it is easy to miss some pixels in the mask that might not be 100% black or white that might be left over from noise or compression of an image pasted into the alpha channel. 

> I don't
> create alpha masks every day, but I'd expect stray pixels in the scenario
> you describe to be 100% opaque. I still believe that > 0.0 is the correct
> initial value.

Well, from my perspective, >0.0 is almost always going to be wrong, and either require an authored value or just be off (acceptably worse, for many). I can't really think of many situations where >0.5 (or >=0.5) would not be visually better. 

For high contrast image shapes, the theoretical shape edge is right in the middle of the anti-aliasing. Granted, that's only going to be a difference of maybe a pixel, but still. THAT is the real edge of the shape. If you rendered a vector image in a raster paint app, that is where the edge would be, and your >0.0 edge would be further out than the vector's edge. If the image is an SVG, don't you use the middle of the vector paths to determine the shape, or do you render it first and then get a shape that is completely outside those paths?

For a fuzzier edge image (say, a picture of a smoke puff), I would most likely want my wrapping text to overlap some of the more translucent pixels, not being so far away that the wrapping area isn't even recognizable as being the same general shape. For shape-inside, I'd want a usable amount of space for the text. A 0.5 default would be much more likely to be useful in both cases. 
Received on Thursday, 12 September 2013 14:45:37 UTC

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