[CREATE] OpenRaster specification: updates to support masking

Andrew Chadwick a.t.chadwick at gmail.com
Fri Jan 17 14:08:51 PST 2014


There is now some working code to test this concept out!

  → https://gitorious.org/mypaint/achadwick-mypaint/commits/layer-enhancements-exp

This partially implements the proposal at

  → https://gist.github.com/achadwick/7827931

To mask with this branch, open the layers panel, then drag a layer
"into" another layer to start building structure,

   Group
   ├ Layer 1
   └ Layer 2

then draw a mask in pure white in the top layer and something you want
to mask in the lower layer in any colour you like. Set the top layer's
compositing mode to "Destination In" using the right button menu, and
the bottom layer (and anything else in the group) will be masked by
the top layer. You may need to refresh the view by dragging it around
a bit at the moment, but this annoyance should be gone soon.

(It has to be in a group because MyPaint does non-isolated rendering
onto its internal background layer. Currently you see black if a layer
erases the background layer... The layer group implementation you see
here uses isolated rendering only, however, and the results of that
are then composited onto the background normally. This is just a
workaround for now, allowing some masking experiments.)

On 13 December 2013 12:01, Boudewijn Rempt <boud at valdyas.org> wrote:
> I firmly intend to look into this into detail -- I'm not forgetting about it :-)
>
> On Friday 06 December 2013 Dec 16:49:10 Andrew Chadwick wrote:
>> I'm in the process of (slowly and experimentally) refactoring the layers
>> code in MyPaint to add a bunch of fancy features like masking, nested
>> layers, and layer formats other than raster (but which either rasterize
>> (like SVG) or can be represented usefully as an icon (like basically
>> nothing right now)).
>>
>> I've noticed that the OpenRaster specification will need to be updated
>> to support the Porter-Duff "in" operator, and I'd like to take the
>> opportunity to allow sub-stacks to be composited with user-specifiable
>> blending and compositing operators. Conveniently enough, the W3C
>> Compositing and Blending Level 1 specification has evolved into a very
>> helpful and complete form, and defines neatly an important aspect of how
>> "groups" in formats like SVG - equivalent to our nested stacks - should
>> be expected to render.
>>
>> Therefore I'd like to update the OpenRaster draft specification[1] in
>> accordance with the attached proposal. See
>> https://gist.github.com/achadwick/7827931 in case the attachment hasn't
>> made it through the mailing list software.
>>
>>
>> [1] http://www.freedesktop.org/wiki/Specifications/OpenRaster/Draft
>>
>>
>
> --
> Boudewijn Rempt
> http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl
>
> _______________________________________________
> CREATE mailing list
> CREATE at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/create



-- 
Andrew Chadwick


More information about the CREATE mailing list