<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="myfilter" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feFlood flood-color="green" flood-opacity="1"/>
</filter>
</defs>
<rect fill="red" height="100px" width="100px"/>
<g visibility='hidden' filter='url(#myfilter)'>
<rect fill="red" height="100px" width="100px"/>
</g>
</svg>