filter effect input and premultiplied alpha
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...
jfb.
On Tue, 12 Feb 2008 00:44:57 +0100, "jf barraud" <jf.barraud@...400...> 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
Ok. ColorMatrix in the current svn (17306) uses premultiplied alpha. So this should be changed. But how can premultiplication be undone? all data is lost when alpha~0, isn't it?
By the way, I guess premultiplication is also involved in the bug affecting turbulence: when transformed (rotated for instance), turbulence becomes more transparent... jfb.
participants (2)
-
jf barraud
-
MenTaLguY