Re: [Inkscape-devel] filter effect input and premultiplied alpha

On Tue, 12 Feb 2008 00:56:19 +0100, MenTaLguY <mental@rydia.net> wrote:

> On Tue, 12 Feb 2008 00:44:57 +0100, "jf barraud" <jf.barraud@gmail.com>  
> wrote:
>> Hi all,
>>
>> Playing with feDisplacement map, and reading the code, I noticed filter
>> effects recieve premultiplied images as input.
>> I would expect non premultiplied images at least for filters that make
>> explicit use of the color channels (like displacement map)...
>>
>> Is this the expected behaviour in svg? If not, I think the issue should  
>> be
>> fixed before 0.46, since all art work based on this would be modified if
>> we change this...
>
> Section 15.7.1 of the SVG spec says:
>
> Unless otherwise stated, all image filters operate on premultiplied RGBA  
> samples. Filters which work more naturally on non-premultiplied data  
> (feColorMatrix and feComponentTransfer) will temporarily undo and redo  
> premultiplication as specified. All raster effect filtering operations  
> take 1 to N input RGBA images, additional attributes as parameters, and  
> produce a single output RGBA image.
>
> Since section 15.15 (feDisplacementMap) does not otherwise explicitly  
> specify, it comes down to an issue of whether or not feDisplacementMap  
> is a filter which works more naturally on non-premultiplied data.  I  
> assume that is the case (I believe that was Batik's interpretation, for  
> example), but I think it should be clarified in the standard.
>
> I've CCed the SVG mailing list for clarification on this.

As Robert Longson pointed out [1] there's an errata item for  
feDisplacementMap already [2].

However, that didn't fully address your concern, so another errata item  
was added [3]. It states that the 'in' image (the image that will get  
displaced) must remain premultiplied.
I've also made the same change to the 1.2 filters module.

Let us know if this doesn't address your concern.
/Erik, on behalf of the SVG WG

[1] http://lists.w3.org/Archives/Public/www-svg/2008Feb/0018.html
[2]  
http://www.w3.org/2003/01/REC-SVG11-20030114-errata#colorinterpolation-fedisplacementmap
[3]  
http://www.w3.org/2003/01/REC-SVG11-20030114-errata#premultiplied-values-fedisplacementmap

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Tuesday, 6 May 2008 08:20:10 UTC