luminanceToAlpha converts the original image into a solid black image with different transparency, it literally converts brightness into alpha values ββand zeros from regular color channels.
For your white image, it converts it to a solid black image (rgb 0,0,0) with 100% opacity. When you multiply something with 0, you get 0. Therefore, when you multiply it with any fill color, you turn black.
For other non-white images, the filter converts them to partially transparent black images. When they reach the blending step, they are pre-multiplied by fully opaque shades of gray before being multiplied by the background color, so you see the color of the flood.
For your case of using white images, you do not want to use L2A, you just need to just multiply.
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'> <defs> <filter id='bronzo-filter'> <feFlood flood-color='green' result='colorfield'/> <feBlend mode='multiply' in='SourceGraphic' in2='colorfield'/> <feComposite operator='in' in2='SourceGraphic'/> </filter> </defs> </svg>
Michael Mullany Jun 15 '17 at 20:58 2017-06-15 20:58
source share