Beispiel:SVG-Filter-09.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0;" />
  <link rel="stylesheet" type="text/css" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
  <style>
svg { 
  background: white;
  border: 1px dotted #3983ab;
  width: 96%;
  height: 500px;
  padding: 0;
  }
  </style>
  <title>Beispiel: Der primitive Filter feGaussianBlur</title>
</head>
 
<body>
  <h1>Beispiel: Der primitive Filter feGaussianBlur</h1>
 
  <main>
  <svg viewbox="0 0 900 500">
  <title>Der primitive Filter feGaussianBlur</title>
 
  <defs>
    <desc>
      6 Beispiele für die Verwendung von feGaussianBlur
    </desc>
    <filter id="f1" x="0" y="0">
      <feGaussianBlur in="SourceGraphic" stdDeviation="1" />
    </filter>
    <filter id="f2" x="0" y="0">
      <feGaussianBlur in="SourceGraphic" stdDeviation="2" />
    </filter>
    <filter id="f3" x="0" y="0" >
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" />
    </filter>
    <filter id="f4" x="-20%" y="-20%" width="150%" height="150%">
      <feGaussianBlur in="SourceGraphic" stdDeviation="5" result="out1" />
      <feBlend in="SourceGraphic" in2="out1" mode="darken" />
    </filter>
    <filter id="f5" x="-20%" y="-20%" width="150%" height="150%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="5" result="out1" />
      <feOffset in="out1" dx="5" dy="5" result="out2" />
      <feMerge>
        <feMergeNode in="out2" />
        <feMergeNode in="SourceGraphic" />
      </feMerge>
    </filter>
    <filter id="f6">
      <feGaussianBlur in="SourceAlpha" stdDeviation="3" />
      <feOffset dx="5" dy="5" />
      <feMerge>
        <feMergeNode />
        <feMergeNode in="SourceGraphic" />
      </feMerge>
    </filter>
  </defs>
 
  <image x="10" y="10" width="200px" height="200px" alt="bild"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Lauf an der Pegnitz - normal ohne Filter</title>
  </image>	
  <image x="230" y="10" width="200px" height="200px" filter="url(#f1)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>&lt;feGaussianBlur in="SourceGraphic" stdDeviation="1" /></title>
  </image>
  <image x="450" y="10" width="200px" height="200px" filter="url(#f2)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>&lt;feGaussianBlur in="SourceGraphic" stdDeviation="2" /></title>
  </image>
  <image x="670" y="10" width="200px" height="200px" filter="url(#f3)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>&lt;feGaussianBlur in="SourceGraphic" stdDeviation="10" /></title>
  </image>
  <image x="230" y="230" width="200px" height="200px" filter="url(#f4)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>&lt;feGaussianBlur in="SourceGraphic" stdDeviation="5" result="out1" /></title>
  </image>
  <image x="450" y="230" width="200px" height="200px" filter="url(#f5)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Schlagschatten #f5</title>
  </image>
  <image x="670" y="230" width="200px" height="200px" filter="url(#f6)"
    xlink:href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Schlagschatten #f6</title>
  </image>	
  </svg>
  </main>
</body>
</html>