Gaussian blur cutoff at edges

旧街凉风 提交于 2019-12-20 11:07:53

问题


I am working on an svg export utility for a drawing program on android. I am having a problem that the behind blur is cutoff past the shape boundaries - looks like i need to resize the viewBox or increase the margin or something. Does anyone know the best way?

The test file url is here - it downloads as the mime type isn't setup correctly on the server and I cant restart it at the moment :(. There are embedded images and fonts in the file, Which is why it's big. But if you save it to disk you can open in chrome, ff, etc...

An enlarged example of this problem is given. Notice the square edges on the orange glow.


回答1:


The filter canvas has default values : x=y=-10% and width=height=120%. You can change them with the x, y, width and height attributes on the filter element.

Try to set a bigger canvas :

<filter x="-50%" y="-50%" width="200%" height="200%"/>

Yet, since the canvas is bigger, there will be performance loss.



来源:https://stackoverflow.com/questions/6555600/gaussian-blur-cutoff-at-edges

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!