W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2014

Re: [filter-effects] A piecewise filter

From: Rik Cabanier <cabanier@gmail.com>
Date: Tue, 25 Mar 2014 08:39:24 -0700
Message-ID: <CAGN7qDBiMGAwkQ52V2S09W-pSrnBdkUUjcGa3SCS3wK-Zrb-Lg@mail.gmail.com>
To: Paul LeBeau <paul.lebeau@gmail.com>
Cc: "public-fx@w3.org" <public-fx@w3.org>
On Tue, Mar 25, 2014 at 12:52 AM, Paul LeBeau <paul.lebeau@gmail.com> wrote:

> Hi
> I was trying to help someone produce an equivalent of the "Overlay"
> blending mode in Photoshop using SVG filters.  However, once I saw the
> formula for it, it became obvious that it isn't really possible to
> reproduce because of its piecewise nature.
> I also notice that "Overlay" is missing from the Compositing and Blending
> spec.  I'm curious why it was excluded considering almost all the other
> ones are represented.

"Overlay" is in the spec:

> But anyway, it made me wonder whether it would make sense to add a new
> filter type that would allow piecewise functions to be implemented.  For
> example, "Overlay" could be implemented using a definition like the
> following:
> <filter id="overlay">
>   <fePiecewise in="SourceGraphic" channelSelector="A">
>     <fePiecewiseNode min="0" max="0.5">
>        <feComposite operator="arithmetic" k1="2" k2="0" k3="0" k4="0"/>
>     </fePiecewiseNode>
>     <fePiecewiseNode min="0.5" max="1">
>        <feComposite operator="arithmetic" k1="-2" k2="2" k3="2" k4="-1"/>
>     </fePiecewiseNode>
>   </fePiecewiseNode>
> </filter>
> Thoughts?

This will have the same security issue that we faced with custom shaders:
you're giving an attacked the ability to change the rendering time based on
the value of a pixel.
Received on Tuesday, 25 March 2014 15:39:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:48 UTC