Re: Subtracting two images in a filter

Ah yes. I forgot about that change.

It was actually "exclusion" that I was trying to emulate.  Looks like it
works in Chrome and FF at least.

    https://jsfiddle.net/fg2wv22r/1/


Thanks Amelia

Paul




On 17 May 2017 at 06:20, Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.
com> wrote:

> I haven't tested browser support (probably not good), but the CSS filters
> spec extends <feBlend> to support all the blend modes from the Blending and
> Compositing spec (https://drafts.fxtf.org/compositing-1/#blending),
> including "difference".
>
> Would that solve your use case?
>
> I'd prefer to mentally keep <feComposite> for operations that rely on
> alpha (like in/out/xor compositing), and `<feBlend>` for color operations
> in which reduced alpha means reduced impact.
>
> ~ABR
>
> On 16 May 2017 at 10:31, Paul LeBeau <paul.lebeau@gmail.com> wrote:
>
>> Hi all
>>
>> I've been experimenting with a filter that requires that I subtract two
>> inputs. I might be missing something, but there doesn't seem to be a way to
>> do that.
>>
>> The closest you can get, that I can see, is with <feComposite>
>>
>>     <feComposite operator="arithmetic" in="a" in2="b" k2="1" k3="-1"/>
>>
>> But because the arithmetic applies to all channels, the alpha channels
>> cancel out and you get a blank result (1-1=0).
>>
>> It seems as if it would be useful if feComposite had a way to preserve
>> the alpha, similar to feConvolveMatrix.
>>
>> Does this idea make sense?  Is it worth creating a feature request to
>> discuss this idea?
>>
>> Paul
>>
>
>

Received on Tuesday, 16 May 2017 18:57:59 UTC