W3Schools.com

SVG feMerge and feMergeNode Elements


SVG Reference Complete SVG Reference

Definition and Usage

The SVG feMerge element is used to create image layers on top of each other.

Each feMerge element can have any number of feMergeNode sub-elements.


Example 1

Copy the following code into Notepad and save the file as "femerge_1.svg". Place the file in your Web directory:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<defs>
<filter id="test" filterUnits="objectBoundingBox"
x="0" y="0" width="1.5" height="4">

<feOffset result="Off1" dx="15" dy="20"/>
<feFlood style="flood-color:#ff0000;flood-opacity:0.8"/>
<feComposite in2="Off1" operator="in" result="C1"/>

<feOffset in="SourceGraphic" result="Off2" dx="30" dy="40"/>
<feFlood style="flood-color:#ff0000;flood-opacity:0.4"/>
<feComposite in2="Off2" operator="in" result="C2"/>

<feMerge>
  <feMergeNode in="C2"/>
  <feMergeNode in="C1"/>
  <feMergeNode in="SourceGraphic"/>
</feMerge>

</filter>
</defs>

<text x="30" y="100"
style="font:36px verdana bold;fill:blue;filter:url(#test)">
This is some text!</text>

</svg>

View example


SVG Reference Complete SVG Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE