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

Hi,

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">
<defs>
	<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"/>
	</filter>
</defs>
<rect width="200" height="200" filter="url(#filter)"/>
</svg>

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’.

Greetings,
Dirk

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