web frontend - How to achieve a Progressive Blur using SVG by combining a filter with a mask? -
i'm trying achieve linear blur effect 1 on image, using just svg, no css!!!
notice how top of image blurred, bottom isn't.
in svg blur effect can achieved using fegaussianblur. gradient can used lineargradient.
how can these 2 combined?
it's possible entirely in filter without using double images, can buggy because of how both firefox , chrome handle ops on low opacities. straightforward way it. note have clip image edges clean image because fegaussianblur creates edge fades.
<svg width="800px" height="600px"> <defs> <lineargradient id="progfade" x1="0%" x2="0%" y1="0%" y2="100%"> <stop offset="0%" stop-color="black"/> <stop offset="60%" stop-color="white"/> </lineargradient> <mask id="progfademask" > <rect x="0%" y="0%" width="100%" height="100%" fill="url(#progfade)" /> <mask> <filter id="blurme" x="0%" y="0%" width="100%" height="100%"> <fegaussianblur stddeviation="15" result="blurry"/> </filter> <clippath id="outerclip"> <rect x="20" y="20" width="460" height="380" fill="black"> </clippath> </defs> <g clip-path="url(#outerclip)"> <image x="0" y="0" filter="url(#blurme)" xlink:href="http://cps-static.rovicorp.com/3/jpg_400/mi0003/890/mi0003890640.jpg" width="494" height="400"/> <image x="0" y="0" mask="url(#progfademask)" xlink:href="http://cps-static.rovicorp.com/3/jpg_400/mi0003/890/mi0003890640.jpg" width="494" height="400"/> </g> </svg> enjoy progressively blurred chaka khan

Comments
Post a Comment