[Webkit-unassigned] [Bug 105776] New: feComponentTransfer linear gives wrong values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 26 15:00:47 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=105776

           Summary: feComponentTransfer linear gives wrong values
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rw12 at cornell.edu
                CC: zimmermann at kde.org


The SVG feComponentTransfer linear function doesn't work as expected. A slope of -1 and intercept of 1 applied to a grayscale image should invert the image: black -> white, white-> black, 25% gray -> 75% gray, 50% gray unchanged, and so on.

http://www.w3.org/TR/filter-effects/#feComponentTransferElement says "C' = slope * C + intercept" where "C is the initial component (e.g., ‘feFuncR’), C' is the remapped component; both in the closed interval [0,1]." Thus slope -1 intercept 1 should applied to C=0.5 should give 0.5.

The following filter

<filter id="linear">
  <feComponentTransfer>
    <feFuncR type="linear" slope="-1" intercept="1" />
    <feFuncG type="linear" slope="-1" intercept="1" />
    <feFuncB type="linear" slope="-1" intercept="1" />
  </feComponentTransfer>
</filter>

maps black to white and white to black, but intermediate values are off, e.g. 50% gray maps to 90% gray and 75% gray maps to 98% gray. See http://jsfiddle.net/Rpjs2/ for a simple example.

http://src.chromium.org/chrome/branches/WebKit/195/LayoutTests/svg/custom/feComponentTransfer-Linear.svg shows another example in which the "invert" example is significantly shifted to the lighter end of the spectrum.

Tested in Safari (WebKit 536.26.17) and Chrome (WebKit 537.11) with same results.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list