0

I like to change the alpha from a SVG Radial Blur Filter? Is there a way to change the alpha to 100%?

Thanks for your time !

Cheers

Alex

.effet{
  width: 400px; height: 300px;
  margin: 0 auto 50px auto;
  background-color: #9c27b0;
}
.filtre--r{
  -webkit-mask: -webkit-radial-gradient( center, closest-side, transparent 30%, black 80%);
  -webkit-mask: radial-gradient( closest-side at center, transparent 50%, black 110%);
  -webkit-filter: blur(5px);
  mask: url('#mask-radial');
  filter: url('#filtre1');
}
<div class="effet">
<img class="filtre filtre--r" src="http://css3create.com/squelettes/images/articles/flou-localise-1.jpg" alt="" />
<svg height="0">
<defs>
  <mask id="mask-radial">
    <rect width="400" height="300" fill="url(#g1)"></rect>
    <radialGradient id="g1" cx="50%" cy="50%" r="50%">
      <stop stop-color="black" offset="50%"/>
      <stop stop-color="white" offset="110%"/>
    </radialGradient>
  </mask>
  <filter id="filtre1">
    <feGaussianBlur in="SourceGraphic" stdDeviation="5"/>
  </filter>
</defs>
</svg>
Michael Mullany
  • 30,283
  • 6
  • 81
  • 105
Alexander Hein
  • 960
  • 3
  • 19
  • 44

1 Answers1

0

This will multiply the alpha by 100 - which will pretty much give you an alpha=1 but with a tiny bit of edge anti-aliasing. (You could set the alpha to 1 directly, but it would set the background to black/opaque as well.)

  <filter id="filtre1">
    <feGaussianBlur in="SourceGraphic" stdDeviation="5"/>
    <feColorMatrix type="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 100 0"/>
  </filter>
Michael Mullany
  • 30,283
  • 6
  • 81
  • 105