W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

Fwd: [CREATE] ORA spec: adding additional layer effects

From: Alexandre Prokoudine <alexandre.prokoudine@gmail.com>
Date: Sat, 25 Feb 2012 19:06:29 +0400
Message-ID: <CAFjkzc1EoA9w6-=py=GriDNK2mgXJjgwZSR-rg2P-xWQEZWaZA@mail.gmail.com>
To: www-svg <www-svg@w3.org>

As far as I can tell,
http://dev.w3.org/SVG/modules/compositing/master/ doesn't cover the
use case either.

What would be your recommendation?

Alexandre Prokoudine

---------- Forwarded message ----------
From: Andrew Chadwick <a.t.chadwick@gmail.com>
Date: Sat, Feb 25, 2012 at 2:19 AM
Subject: [CREATE] ORA spec: adding additional layer effects
To: create@lists.freedesktop.org, mypaint-discuss <mypaint-discuss@gna.org>

The OpenRaster spec currently states (working from memory here) that
ORA files may use uses the SVG compositing ops[1]. These do not
provide colorize layer modes, nor modes for luminosity-setting,
hue-setting or saturation-setting. I'd quite like to implement these
but because it would require a change to the OpenRaster specification,
I haven't yet. Users are clamouring for it however, and I think
MyPaint should implement colourize at least (not to mention I have
some sample code kicking around locally).

Currently layers with compositing modes other than "svg:src-over" are
written to layers.xml with a suitable "composite-op" attribute:

 <layer composite-op="svg:src-over" opacity="1.0"
src="data/layer001.png" visibility="visible" x="0" y="0" />

What I suggest doing is extending the current definition with the
following modes:

* SOMEPREFIXhue - src hue, and luminance and saturation of the dst
* SOMEPREFIXsaturation - saturation of the src layer, with the hue and
luminance of the dst
* SOMEPREFIXcolor - hue and saturation of the src, with the luminance of the dst
* SOMEPREFIXluminosity - luminance of the src, over the hue and
saturation of the dst

Definitions of these blending modes can be found in various PDF
specifications[2], and work well up until one has to composite with an
opacity setting using scaled ints. Which is a whole new kind of fun.

What should we use for SOMEPREFIX? "pdf:blend-" is one possibility if
we want to slavishly adopt that... but I'd rather refer to a more open
specification if I can (not to mention that I want to use the Rec. 709
primaries[3] for the perceptual-ish bit). Current SVG specification
(1.1) is indeed luminosity/luma aware for feColorMatrix, but does not
define these blend modes, sadly.

MyPaint could of course just do its own thing here, or copy Krita.
I've had a quick poke around the Krita and GIMP implementations of
these layer modes, but they seem to use HSV only, which seems
limiting. Is there any particular reason for this?

[1] http://www.w3.org/TR/SVGCompositing/
[2] The shortest and most relevant one is probably the "PDF Blend
Modes: Addendum" for the PDF Reference, fifth edition, version 1.6,
dated Jan 23 2006 - available from Adobe via your search engine of
[3] https://en.wikipedia.org/wiki/Rec._709

Andrew Chadwick
CREATE mailing list
Received on Saturday, 25 February 2012 15:06:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:34 UTC