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" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
  <style>
svg { 
  background: white;
  border: thin dotted #337599;
  width: 96%;
  height: 500px;
  padding: 0;
  }
  </style>
  <title>Beispiel: Der primitive Filter feGaussianBlur</title>
</head>
 
<body>
  <h1>Beispiel: Der primitive Filter feGaussianBlur</h1>
 
  <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"
    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)"
    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)"
    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)"
    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)"
    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)"
    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)"
    href="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Schlagschatten #f6</title>
  </image>	
  </svg>
 
</body>
</html>