![]() This is nominally achieved by connecting to the "Background Image" source in the filter editor, but there's more to it than that. For this filter, however, we need to read each background pixel and use it to calculate the value of the filter's output. For example, if you add a Gaussian Blur to a rectangle it's only the pixels in the rectangle that are used, with the final result being overlaid on the background. Usually filters just act on the object to which they're applied. ![]() The documentation for Component Transfer is usually tricky to follow, and gets too mathematical, but the short version is that setting R, G & B to 'Discrete' with values of '1 0' does the trick (example attached).įor anyone that's interested in this topic, and why I suggested using Component Transfer rather than Color Matrix, here's a bit of a breakdown of what's happening.Īim: The filter should invert the colour of every pixel beneath it such that black (RGB: 0, 0, 0) becomes white (RGB 255, 255, 255) and vice versa. a step function where any values below 0.5 are converted to 1.0, and values above 0.5 are converted to 0. You can also use a Component Transfer filter instead of the Color Matrix filter, which is arguably more in keeping with the spirit of what you're trying to do - i.e. You also need to add a Composite step, with the operator set to "In" and the second source as "Source alpha", for it to work with shapes other than horizontally aligned rectangles. That's good news! It's a shame that there's no way to add the attribute except via the XML editor (why does this still not get added when a filter uses Background Image/Alpha?), and even more of a shame that a restart is needed (I'm pretty certain that didn't used to be the case, but I wouldn't swear to it). It's a real measure of just how complex something is when I describe creating a filter in Inkscape as the simpler option! There might be something possible with a Frankenstein combination of clones, masks and filters, but nothing that's as simple and practical as just applying a single filter that uses the background image as a source. Unfortunately I can't think of any practical workarounds. So many good features in SVG are being subsumed into CSS - but with less capability - and I think this is probably a victim of the same 'progress'. It's a shame, as it could enable effects and tricks that just aren't possible any other way - and I never really understood why it was never fixed to work out-of-the-box with the filter editor, without requiring the layer blend mode hack. The 'enable-background' attribute is listed as deprecated in SVG2 ( ), so I can only assume that the move to support more SVG2 features in Inkscape has meant that what little support there was for this feature is effectively gone. You're right, the old trick doesn't seem to work any more and, as you've found, manually adding the attribute doesn't help.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |