Bug 136418

Summary: SVG filter effect feGaussianBlur unexpectedly lightens image using linearRGB
Product: WebKit Reporter: David Bonnet <david>
Component: SVGAssignee: frankhome61
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, dino, frankhome61, sabouhallawa, simon.fraser, thorton, zimmermann
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=202826
https://bugs.webkit.org/show_bug.cgi?id=181267
https://bugs.webkit.org/show_bug.cgi?id=105929
https://bugs.webkit.org/show_bug.cgi?id=212649
Attachments:
Description Flags
SVG example showing the blur effect with sRGB and linearRGB
none
Rendering comparison between Chrome and WebKit Nightly none

Description David Bonnet 2014-08-31 10:45:10 PDT
Created attachment 237428 [details]
SVG example showing the blur effect with sRGB and linearRGB

When using a gaussian blur filter effect, the resulting image is lightened when using linearRGB for color interpolation. The attached file shows the color alteration. When using the sRGB for color interpolation, results are consistent across browsers, yet the blur effect is less desirable.

This bug has been witnessed on several occasions:
- http://stackoverflow.com/questions/24295043/svg-gaussian-blur-in-safari-unexpectedly-lightens-image
- http://stackoverflow.com/questions/22615663/safari-renders-wrong-colors-when-using-blur-filter

From the comments on the pages mentioned above, it seems to have been introduced since Safari 7.
Comment 1 David Bonnet 2014-08-31 10:51:35 PDT
Created attachment 237429 [details]
Rendering comparison between Chrome and WebKit Nightly
Comment 2 Alexey Proskuryakov 2014-08-31 23:57:43 PDT
>From the comments on the pages mentioned above, it seems to have been introduced since Safari 7.

I can reproduce this with Safari 7.0.6 on OS X 10.9.4, so this doesn't look like a regression despite the above.
Comment 3 Simon Fraser (smfr) 2018-01-03 16:57:03 PST
I thikn the bug here is that FilterEffect::imageBufferResult() just splats m_premultipliedImageResult into m_imageBufferResult without any linearRGB -> sRGB conversion, and transformResultColorSpace() does nothing for CG (because it assumes that the result will be obtained by painting via CG, which is not accurate).
Comment 4 Simon Fraser (smfr) 2018-01-03 16:57:27 PST
Bug 180565 is the same issue, but on input.
Comment 5 Simon Fraser (smfr) 2018-01-03 17:03:35 PST
(In reply to Simon Fraser (smfr) from comment #4)
> Bug 180565 is the same issue, but on input.

That's the wrong bug. I meant bug 181267.
Comment 6 frankhome61 2020-06-11 13:15:26 PDT
This bug is fixed in a recent patch https://bugs.webkit.org/show_bug.cgi?id=212649
Comment 7 Simon Fraser (smfr) 2020-06-11 20:37:24 PDT

*** This bug has been marked as a duplicate of bug 212649 ***