W3C home > Mailing lists > Public > public-fx@w3.org > October to December 2013

[filter-effects] 'in2' on feBlend and feComposite

From: Dirk Schulze <dschulze@adobe.com>
Date: Fri, 6 Dec 2013 05:41:32 -0800
To: Tavmjong Bah <tavmjong@free.fr>
CC: "public-fx@w3.org" <public-fx@w3.org>, www-svg list <www-svg@w3.org>
Message-ID: <436FCD3C-7F99-4E66-B4CF-4E459A380F96@adobe.com>

Tav wrote the following request:

On Nov 13, 2013, at 10:13 PM, Tavmjong Bah <tavmjong@free.fr> wrote:

>> On Nov 12, 2013, at 4:51 AM, Tavmjong Bah <tavmjong@free.fr> wrote:
>>> Since there seems to be a lot of discussion planned at the TPAC F2F for
>>> filter effects, I want to add a few issues to the list:
>>> 1. 'in2'
>>> For 'feBlend' and 'feComposite' the spec says:
>>> in2 = "(see ‘in’ attribute)"
>>>   The second input image to the compositing operation. This
>>>   attribute can take on the same values as the ‘in’ attribute.
>>> I interpret this that 'in2' behaves like 'in', thus if 'in2'
>>> is not given and this is the first primitive, 'SourceGraphic'
>>> is used, if not given and this is not first primitive,
>>> the result of the previous filter is used.
>>> Inkscape, rsvg, and Opera (12.16) agree with this
>>> interpretation. Batik as well as 'validator.w3.org'
>>> says 'in2' is required.  Firefox and Chrome require
>>> 'in2' to be defined.
>>> For an example, see:
>>> http://tavmjong.free.fr//INKSCAPE/MANUAL/images/FILTERS/Filters_SolarFlare.svg
>> I think this is a misinterpretation. This sentence really just says that in and in2 can have the same input. It does not say anything like “if in2 is not specified, then take the input of in”. To make this clear, it should maybe transformed into a note and be rephrased.
> I don't have a strong feeling either way, although since 'in' and 'in2'
> can have the same input, it would be reasonable that 'in2' follow the
> same rule as 'in’.

I created a simplified test case and it looks like whatever is not working on Tavs example has nothing to do with the interpretation of ‘in2’.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<filter id="filter">
		<feFlood flood-color="rgb(255, 0, 0)" result="in1"/>
		<feFlood flood-color="rgb(0, 255, 0)" result="in2"/>
		<feBlend mode="multiply" in="in1"/>
<rect width="200" height="200" filter="url(#filter)"/>

http://jsfiddle.net/2jwv5/ (for testing)

In this example feBlend has the first input “in1” which is blended with the second input. However, the attribute ‘in2’ is not specified. If ‘in2’ would take the same input as ‘in’, you should see a red square. Instead you see a black square in Blink, WebKit, Opera (Presto) and IE. ‘in2’ actually behaves exactly like ‘in’ and references the previous filter primitive in the filter chain.

I suggest that we resolve to have the same behavior of ‘in2’ as for ‘in’.

Received on Friday, 6 December 2013 13:42:10 UTC

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