Beispiel:SVG-Filter-feDiffuseLighting-2.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html>
<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 {
  width: 96%;
  height: 600px;
  padding:0;
  margin:0;
  background: white;
}

text {
   font-family: serif; 
   font-size: 25px;
}

</style>
  <title>Beispiel: feDiffuseLighting-2</title>
</head>
 
<body>
  <h1>Reliefstruktur</h1>

<main>

<svg viewBox="0 0 880 600">
  <defs>
  <filter id="Relief" width="100%" height="100%" x="0" y="0">
    <feColorMatrix in="SourceGraphic" type="luminanceToAlpha"/>
    <feDiffuseLighting surfaceScale="10" lighting-color="white">
      <feDistantLight azimuth="50" elevation="50"/>
    </feDiffuseLighting>
  </filter>
  </defs>

<text x="10" y="40">ohne Filter</text>
<image x="10" y="60" width="200px" height="200px"
    xlink:href="http://wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Lauf an der Pegnitz - normal ohne Filter</title>
</image>

<text x="310" y="40">Relief</text>
<image x="10" y="60" width="400px" height="400px" filter="url(#Relief)" transform="translate(300,0)"
    xlink:href="http://wiki.selfhtml.org/images/a/a6/Lauf-1.jpg">
    <title>Lauf an der Pegnitz - normal ohne Filter</title>
</image>

</svg>

</main>

</body>
</html>