You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It says: "Having chosen the appropriate color space, component-wise linear interpolation is used." The available color spaces are linearRGB and sRGB.
Interpolating colors with non-1 opacity should use associated alpha for interpolation, or at least there should be an option for using associated alpha (like offering linearRGBaa as an option).
Why should color interpolation work like this? This way the two operations of blending the colors with a solid color background and applying the interpolation are interchangeable. Imagine a gradient between fully opque red and fully transparent "blue" on a white background. According to the current standard in the middle we get light purple. With associated alpha we exactly get a gradient between red and white.
The text was updated successfully, but these errors were encountered:
(Edited because my first reply was just wrong - haven't thought about this a while and I was getting confused with something else).
This is the way SVG is intended to work. You get blue because the colour is transitioning to blue as the alpha is transitioning to transparent. The author has specified a colour, so that colour has some significance. If you want to transition red to transparent red, then specify those colours.
Agree this is different to CSS. Have a look at issue #180 for the back story.
Ok, I see that #180 addresses this for gradients, but note that color-interpolation is also used for filter effects too (among other stuff). I can also see that this can be a desired effect, also I can see gradients in premultiplied/associated alpha can be a desired effect too, so having both couldn't hurt.
Now imagine if I include a transparent png in my svg, put it on a light background and apply gaussian blur on it. If the png file's transparent parts are "black", then the image at the edges of opaque regions gets black leaked in and looks "dirty". I might not want that. I also might not want to blend with the background before and then applying the gaussian blur because I might not want to blur the background too.
https://www.w3.org/TR/2016/CR-SVG2-20160915/painting.html#ColorInterpolation
It says: "Having chosen the appropriate color space, component-wise linear interpolation is used." The available color spaces are linearRGB and sRGB.
Interpolating colors with non-1 opacity should use associated alpha for interpolation, or at least there should be an option for using associated alpha (like offering linearRGBaa as an option).
Why should color interpolation work like this? This way the two operations of blending the colors with a solid color background and applying the interpolation are interchangeable. Imagine a gradient between fully opque red and fully transparent "blue" on a white background. According to the current standard in the middle we get light purple. With associated alpha we exactly get a gradient between red and white.
The text was updated successfully, but these errors were encountered: