0

Is there a way to reverse a luminanceToAlpha?

<feColorMatrix type="luminanceToAlpha"></feColorMatrix>

From this:
enter image description here

To This
enter image description here

Dennis Betman
  • 330
  • 1
  • 5
  • 18

1 Answers1

2

Well a fast way is to do this:

<feColorMatrix type="matrix" values="0 0 0 1 0
                                     0 0 0 1 0
                                     0 0 0 1 0
                                     0 0 0 0 1"/>

But a warning that the result will be a greyscale that won't match a greyscale conversion of the original (if the original was color) - because the Red/Green/Blue channels have very different contributions to luminance -> which is 0.30 * Red + 0.59 * Green + 0.11 * Blue. In other words, you're going to get a green-overweight, blue-underweight greyscale.

Michael Mullany
  • 30,283
  • 6
  • 81
  • 105