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

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.

-mental

Received on Monday, 11 February 2008 23:56:33 UTC