How would I create a svg filter to map all translucent pixels to opaque pixels? All transparent pixels should remain transparent.
I am trying to create a shape mask but need the edges of the masks to be fully opaque. Otherwise I am left with a halo when I use the mask. Here is an example of the halo I am trying to remove with this SVG filter: https://codepen.io/jedierikb/pen/yGYqKK
This answer here does something similar - setting all translucent pixels to transparent pixels using a feComponentTransfer
.
Suggestions?
Just for comparison with Paul's answer, here is a filter with
type="linear" slope="255"
Here's one way. All values of A except for 0 are set to 1 (opaque).