Skip to content

[filter-effects-1] Clarify color-interpolation-filters behavior on feMerge #326

Open
@RazrFalcon

Description

@RazrFalcon

https://drafts.fxtf.org/filter-effects/#propdef-color-interpolation-filters, https://drafts.fxtf.org/filter-effects/#feMergeElement

Let's say I have something like this:

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <filter id="filter1" filterUnits="userSpaceOnUse" width="200" height="200">
        <feGaussianBlur in="SourceGraphic" stdDeviation="1" color-interpolation-filters="sRGB" result="blur1"/>

        <feGaussianBlur in="SourceGraphic" stdDeviation="1" color-interpolation-filters="linearRGB"/>
        <feOffset dx="40" dy="40" result="blur2"/>

        <feMerge color-interpolation-filters="linearRGB">
            <feMergeNode in="blur1"/>
            <feMergeNode in="blur2"/>
        </feMerge>
    </filter>
    <g filter="url(#filter1)">
        <rect x="40" y="40" width="40" height="40" fill="yellow"/>
        <rect x="60" y="60" width="40" height="40" fill="blue"/>
    </g>

    <rect x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>
  1. What color space feMergeNode should use? The one that set on the parent feMerge or on the result primitive?
  2. I have to convert all in images/buffers to the specified color space, than merge them, than convert the result back to sRGB? Or should I leave it in the specified color space?
    This one actually affects all filters. Should the result be kept in the specified color space or should it be converted back to sRGB?

The actual results are mostly ok. The main problem is that Batik breaks colors and my application have a wrong color on the overlapped part.

1543746775

* the diff is relative to Chrome

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions