[英]How can i create an svg filter that combines feTurbulence and feGaussianBlur
這是我相信你想要的一個例子。
您必須在模糊后應用顆粒。 因為如果你反過來做,你只會模糊紋理。 而且很可能會失去效果。
svg { width: 500px; }
<svg viewBox="0 0 100 100"> <filter id="blur-plus-grain" x="-50%" y="-50%" width="200%" height="200%"> <!-- Blur the input object --> <feGaussianBlur stdDeviation="10" result="blur"/> <!-- Create some grainy noise --> <feTurbulence type="fractalNoise" baseFrequency="0.95" numOctaves="3" stitchTiles="stitch"/> <!-- Make the grain greyscale --> <feColorMatrix type="saturate" values="0" result="grain"/> <!-- Composit the grain onto the blurred object --> <feComposite operator="in" in="blur" in2="grain"/> </filter> <ellipse cx="50" cy="50" rx="30" ry="20" fill="gold" filter='url(#blur-plus-grain)'/> </svg>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.