Re: [css-masking] mask-composite, vocabulary, and use cases

On Apr 23, 2014, at 11:31 AM, Dirk Schulze <dschulze@adobe.com> wrote:

> 
> On Apr 23, 2014, at 10:00 AM, fantasai <fantasai.lists@inkedblade.net> wrote:
> 
>> I'm looking at
>> 
>> mask-composite: clear | copy | destination | source-over | destination-over
>>                 | source-in | destination-in | source-out | destination-out
>>                 | source-atop | destination-atop | xor | lighter
>> 
>> and the syntax is completely arcane to me. The examples make sense.
>> But I'm not a graphics-library person, so I can't relate to the
>> vocabulary in use here.
>> 
>> Do we have to use Porter-Duff vocabulary, or would it be okay to use
>> more vernacular English for some of these terms? E.g. "source" and
>> "destination" mean nothing to me in terms of CSS objects, so I can't
>> tell what they correspond to.

I looked more into the behavior of authoring tools. A common pattern seems to be the following:

combine/add	->	source-over (normal painting)
subtract		->	source-out
intersect		->	source-in
exclude		->	xor

Tools are inconsistent with the use of add or combine. I slightly prefer combine.

I didn’t find examples for source-atop neither in content nor in authoring tools. Maybe it is not that common and could be added later if necessary.

It is important to understand that the keywords make a lot of sense for content that is either opaque or transparent. For half transparent shapes, the operations are similar to what can be seen here [1] (blue filled rect is destination, red stroked rect source). Either source or destination would still shine through. That is expected and even the case for xor. Therefore, I do not see a problem with the names subtract and intersect.

I will do the changes in the next days.

Greetings,
Dirk

[1] https://bug-66762-attachments.webkit.org/attachment.cgi?id=104816

Received on Thursday, 24 April 2014 10:48:22 UTC