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

About svg2 filters draft

From: Yves followdsvg <svgadopter@gmail.com>
Date: Thu, 13 Dec 2012 00:24:10 +0100
Message-ID: <CAN82MDsKdOWcYxm8+s7M-5mzNgvUgpwmbaF5b4tGiNPLW8cHFA@mail.gmail.com>
To: www-svg@w3.org

I don't know if it's the right place to post but here are some thoughts


(0) Maybe add some notes about valid/safe values for coefficients with
minimal requirement
I (think I) understood that coefficients are unbounded.

>  Values outside the 0..1 range under- or oversaturates the filter input
image respectively

I heavily use values such as 256 for feColorMatrix.
I use them so that, after computation, an input value in range [0,1] maps
0 if input was 0,
1 if input was > 0.

Should implementations ensure that summing won't exceed the capacities of
their internal "storage" ?
(Of course they should but maybe one can add some words about it ?)

(1) feDropShadow : angle and distance instead of (or along with) dx,dy

Instead of dx, dy for offseting the dropshadow I'd rather see two
properties "angle" and distance.
(think gimp drop shadow vs photoshop).
Valid values for angle would be [0,360[ with lacuna value of 90 (or
"globalLightSource" ?)

(2) feDropShadow : globalLightSource

Another valid value for angle could be "globalLightSource"
with globallightSource a new property of the svg tag (or any group tag ?)
(with a lacuna value of 50%, -infinite)

For every shape, the angle is calculated by taking the center of shape and
the "position" of a global light source.

So after you designed your whole scene, if you decide the sun is at noon
instead of 11am,
you won't have to look after every shape to change this dx,dy you just set
the sunposition of svg and voilà.

I know there could be more than one light source in a scene. But it's
better than nothing (and better than just dx,dy)
Maybe we could use xlinking instead of just "globalLightSource" ?

(3) feDropShadow : Spread property

I think feDropShadow lacks a spread property. This could be simulated using
a feMorphology as first stage.

The result of a ‘feDropShadow’ filter primitive would be equivalent to the

    <feMorphology in="alpha-channel-of-feDropShadow-in" operator="dilate"
radius="spread-radius" />
  <feGaussianBlur stdDeviation="stdDeviation-of-feDropShadow"/>
  <feOffset dx="dx-of-feDropShadow" dy="dy-of-feDropShadow"
  <feFlood flood-color="flood-color-of-feDropShadow"
  <feComposite in2="offsetblur" operator="in"/>
    <feMergeNode in="in-of-feDropShadow"/>

maybe it could accept neg values for radius then the operator feMorphology
would be "erode" with a radius of "-spread-radius".

(3b) feMorphology : new operator "spread"

instead of juggling with erode or dilate one could define a new operator
for femorphology ("spread" ?) which accepts positive or negative value.
With positive values it dilates with neg it erodes.

(4) feTurbulence : new type "random"

add a new algorithm that returns a value in [0,1] by applying the classical
random() for every "dot".
Basefrequencies could accept integers that would be the size of the dots.
Usefull for layer effect like diffuse (and deliberate pixelation if you
play wwith base frequencies)

(4b) feTurbulence : new property "preserveGrey" (sorry can't find a better

This property will accept any combination of R,G,B,A (eg : "RB") ; lacuna
value would be "";
When set, the result of feTurbulence for every channel listed in property
is "weighted" so that sum() = sum(grey).
It would be usefull when you want to do a feDisplacementMap(scale) followed
by a Offset(scale/2,-scale/2) and be sure it would not move too much.

(5) feDisplacementMap : allow "none" in addition to "R,G,B,A" for

Sometimes you don't want to displace along one axis. For now you need to
empty one of the channel. This looks very uneccesary to me.

(6) feComposite : new property "alpha"
fecomposite : please, please, please allow computation to exclude the
alpha. Everything would be that much easier without this alpha
May I suggest an alpha property that indicates how to handle it ?
valid values would be :
"k"         => compute as usual (would be the lacuna value)
"in", "in2" => alpha output = alpha of input 1 or 2
[0,1]       => alpha output = const

(7) 4 new in sources for filter

StrokeGraphic + FillGraphic (~= SourceGraphic)
StrokeAlpha   + FillAlpha   (~= SourceAlpha)

StrokeGraphic => same as SourceGraphic but without fill property   (like if
all fill properties of elements were set to "none")
FillGraphic   => same as SourceGraphic but without stroke property (like if
all stroke properties of elements were set to "none")

Yeah I already got a response by Jasper van de Gronde about this last one
but it was a bit off topic.
We talked about speed issues of femorphology. But if femorphology could be
solution to get the stroke for some simple case,
I think it would be more convenient to have those 4 new sources. For me,
StrokeGraphic looks more usefull than the existing StrokePaint for exemple
: it could be use to make complex borders (groove, double, bumped...)


What I missed the much in svg for now :
 meshes gradient (or diffusion curves ;) ),
 being able to offset the stroke so that it is fully outset (and not 50%
inset, 50% outset)
 natural y (viewport 1,-1 is not a solution because of font going top/down)

Thank you for reading.
Received on Wednesday, 12 December 2012 23:24:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:30 UTC