TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Making noisy SVGs

499 pointsby dimmkeover 1 year ago

23 comments

Tistronover 1 year ago
I recently was playing with SVG, to get a dropshadow I couldn&#x27;t make when drawing on canvas. I could not get css dropshadows in SVG working in Safari and had to use SVG native drop shadow filters, and then that looks different in Safari than in the other browsers.<p>The specific thing is at <a href="https:&#x2F;&#x2F;www.einarmagnus.net&#x2F;pages&#x2F;logo" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.einarmagnus.net&#x2F;pages&#x2F;logo</a> I do my best to detect safari with javascript and activate the SVG version and disable the css version.<p>Background on the &quot;recursive yin yang&quot; is here: <a href="https:&#x2F;&#x2F;einarmagnus.net&#x2F;blog&#x2F;2020&#x2F;01&#x2F;22&#x2F;finding-the-logo" rel="nofollow noreferrer">https:&#x2F;&#x2F;einarmagnus.net&#x2F;blog&#x2F;2020&#x2F;01&#x2F;22&#x2F;finding-the-logo</a><p>Maybe I&#x27;ll play with texture, I like that aesthetic a lot. But it is frustrating that it looks so differently in Safari. Do you think that they will converge on how they interpret SVG?
评论 #38562149 未加载
评论 #38563438 未加载
评论 #38562860 未加载
评论 #38561095 未加载
评论 #38562115 未加载
评论 #38566890 未加载
评论 #38565150 未加载
Minor49erover 1 year ago
&gt; I’m not hip enough to know if this style has been assigned a pithy label, but I do enjoy it. At the same time, I find it frustrating — because as far as I can tell (the lack of examples I have seen in the wild supports this theory) there isn’t an easy way to replicate these illustrations with SVGs<p>The term the author is looking for is &quot;dithering&quot;. CSS-Tricks explains this on their page &quot;Grainy Gradients&quot; using the same technique:<p><a href="https:&#x2F;&#x2F;css-tricks.com&#x2F;grainy-gradients&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;css-tricks.com&#x2F;grainy-gradients&#x2F;</a><p>There&#x27;s also a decent alternative to doing this with CSS, though it&#x27;s applied to the entire image:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tomren1&#x2F;dither-with-css">https:&#x2F;&#x2F;github.com&#x2F;tomren1&#x2F;dither-with-css</a>
评论 #38561650 未加载
评论 #38561269 未加载
评论 #38560101 未加载
评论 #38560662 未加载
评论 #38560502 未加载
esafakover 1 year ago
This reminds me of how film photographers and film-makers strived to eliminate grain while digital photographers felt the need to add it back in. The grass is greener on the other side!<p>I confess to finding the examples on this page quite appealing, amidst all the digital sterility.
评论 #38560165 未加载
评论 #38560396 未加载
geokonover 1 year ago
Does anyone have any resource on which features are broken across implementations? How to stay sane with SVG?<p>I recently made the mistake of making a complex conference poster using SVG. It now renders different in every browser and program<p><a href="https:&#x2F;&#x2F;kxygk.github.io&#x2F;imergination&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;kxygk.github.io&#x2F;imergination&#x2F;</a><p>In making the graphic I noticed:<p>- You can include&#x2F;link SVGs to embed, but if they in turn include other SVGs then it will not work (ex: the poster -&gt; diagrams -&gt; several plots&#x2F;maps). So dynamic SVGs that are updated when subimages change are impossible<p>- Webbrowsers randomly and will refuse to display embedded&#x2F;linked image b&#x2F;c of &quot;security&quot;<p>- Ex: in the above link, if you try to open the SVG in a separate tab it won&#x27;t display correctly: <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;wiki&#x2F;kxygk&#x2F;imergination&#x2F;agu2023-poster.svg" rel="nofollow noreferrer">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;wiki&#x2F;kxygk&#x2F;imergination&#x2F;ag...</a><p>- It was basically impossible to turn a complex SVG into a PDF without inconsistencies and&#x2F;or running out of RAM<p>- Every SVG-to-PDF converter gives different results<p>- Many implementations (ex: Inkscape) will randomly treat included SVGs are a raster graphic. I never pinpointed when this would occur (and even then, when rendering to PNG Inkscape doesn&#x27;t propagate the DPI setting to subimages)
Tao3300over 1 year ago
That&#x27;s cool. Looks like Inkscape supports adding this kind of noise through its various effects in its Filters menu. Exported as a Plain SVG and looking at the code confirms the use of feTurbulence.<p>For comparison, I also did a test to see how Affinity Designer 2 does it, since it has noisy fills. The SVG it exports has the noise embedded in it as a base64 jpeg image!
评论 #38562258 未加载
评论 #38563386 未加载
Retr0idover 1 year ago
The &quot;ApeFest&quot; website[1] (yeah, the one that burnt attendees&#x27; retinas with UV) has some dynamic noise going on, and I had a look at the CSS. They&#x27;re actually using a tiled PNG overlay[2], which gets wobbled around &quot;randomly&quot; using CSS animations (edit: actually, looks like they move it with JS). Pretty low-tech, but it works.<p>[1] <a href="https:&#x2F;&#x2F;apefest.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;apefest.com&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;framerusercontent.com&#x2F;images&#x2F;rR6HYXBrMmX4cRpXfXUOvpvpB0.png" rel="nofollow noreferrer">https:&#x2F;&#x2F;framerusercontent.com&#x2F;images&#x2F;rR6HYXBrMmX4cRpXfXUOvpv...</a>
评论 #38560170 未加载
chrismorganover 1 year ago
I’ve wanted to use a variety of SVG filters like this at times, but the problem is that their appearance varies significantly from engine to engine and by scaling factor, and so it only ends up working for subtle things where imprecisions don’t matter much, and I end up regretfully but consistently going back to raster stuff. Also the pixel-by-pixel nature of them means that things like feDisplacementMap destroy antialiasing, which spoils half of the situations you might like to use it.
aidenn0over 1 year ago
Perlin Noise (and it&#x27;s successor Fractal Noise) are incredible bang-for-your-buck when adding realism and&#x2F;or an &quot;organic&quot; feel to things. You can see it used to great effect, for example, in <i>Aladdin (1992)</i> for the scene where they escape from the Cave of Wonders.
IshKebabover 1 year ago
I&#x27;m not sure what it&#x27;s supposed to look like, but on my phone that looks like a smooth gradient with no noise.
评论 #38563084 未加载
评论 #38565166 未加载
ortichicover 1 year ago
I like the effect, but is there a way to make it independent of the zoom level?<p>On a related note, this probably adds randomness, is there a way to seed it? For example to be able to define a single correct render result at a given size.
评论 #38560779 未加载
评论 #38562984 未加载
FrostKiwiover 1 year ago
FYI, don&#x27;t use this as page backgrounds. I tried weeks ago and there are all kinds of weird bugs cropping up on various devices up to full page freezes for larger sites or the svg simply stopping rendering after some size.<p>Using this for lovely pixel sized noise backgrounds is what I would love, but it&#x27;s not there yet on the performance and stability side.
globular-toastover 1 year ago
This looks really strange in Firefox. Especially in the full example[0]. The &quot;noise&quot; has regularity as if it has been tiled and almost looks like it has been run through a lossy compressor.<p>[0] <a href="https:&#x2F;&#x2F;danielimmke.github.io&#x2F;noisy-shapes&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;danielimmke.github.io&#x2F;noisy-shapes&#x2F;</a>
评论 #38560508 未加载
qrohlfover 1 year ago
Early versions of Trianglify supported noise addition using feTurbulence but I ultimately removed it because of some of the rendering inconsistencies mentioned in this thread, alongside performance issues on certain platforms (you would think that generating 2d monochrome noise would be pretty cheap in this day and age, but it must be part of the SVG stack that never saw much optimization because it would absolutely lock up rendering for several hundred milliseconds when applied to even moderately sized viewports).<p>Of course, this was all back in ~2015 so the landscape has definitely improved, but not quite to the point where I would consider adding support back in.
dexwizover 1 year ago
Reminder that art is cyclic. This reminds me of the Memphis airbrushed geometric art from the 80s.<p>The latest flat design cycle is dead, and one way to evolve is take the latest generation (flat) and combine it with current retro trend (80s&#x2F;90s redistilled by GenZ). So you take the natural noise generated by airbrushed artwork of the 80s&#x2F;90s and translate that into digital art via gradients. Voilà! You have a style that will dominate the digital art landscape for the next few years.
评论 #38560109 未加载
jessehattabaughover 1 year ago
The examples are practically invisible in dark mode. The author should use rasterized screenshots with white backgrounds, or a media query with a brighter color.
评论 #38559973 未加载
评论 #38560350 未加载
评论 #38560327 未加载
j0hnylover 1 year ago
&quot;It’s not perfect, and notably renders differently in Safari than other browsers but it achieves what I set out to accomplish.&quot;<p>This is the part that drives me nuts. I do a lot of generative art with SVGs and avoid the filters altogether because of this.
rpigabover 1 year ago
I was wondering if it would be wise and feasible to add WebGL shaders over SVGs?
JamieDawsonCodeover 1 year ago
This specific style of grain on SVGs reminds me of 1970&#x27;s Sci-Fi art that depicted the future. Thank you for making this tutorial, I&#x27;m gonna have to experiment with this!
nektroover 1 year ago
i believe this design style came out of <a href="https:&#x2F;&#x2F;fluent2.microsoft.design&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;fluent2.microsoft.design&#x2F;</a>
gatkinsoover 1 year ago
Really excellent work
zaikover 1 year ago
Mobile Firefox seems to have an allergic reaction to this page when zooming in on the SVGs.
RugnirVikingover 1 year ago
ooh this is cool. Is there any support for gradients of these? I guess maybe you could do some mask thing for opacity. But it would be cool if we could vary the fractal noise frequency
pdn1over 1 year ago
Gradient.