Top
Best
New

Posted by sadiq 12/11/2025

An SVG is all you need(jon.recoil.org)
347 points | 148 commentspage 2
martijn_himself 12/11/2025|
>They are supported on just about every device and platform

Except they aren't. I recently used a simple SVG in a background and Safari wasn't able to render it properly so after trying lots of different things I gave up and used different sizes of raster images instead.

stanac 12/11/2025||
SVGs also are mostly unsupported for og:image tags (dependents on the app/browser). I know it's supper specific and I am not even sure if open graph is standardized protocol or not, but it's used everywhere.
airstrike 12/11/2025|||
yeah, I was super disappointed to find that out when I built previews for https://hexrgb.pages.dev
avsm 12/11/2025|||
What was the SVG that didn't work? In Jon's example in the original post, the SVG he embeds there was one he wrote in around 2005. That's a pretty impressive run for it to render 20 years on...
SoKamil 12/11/2025||
They are also not supported on iOS native apps. We use pdfs for vectors.
krisoft 12/12/2025||
I once solved a machining problem using SVG and a bit of javascript and python.

I was prototyping an orrery. It involved cutting out a lot of ad-hoc gears and frame bits on my CNC out of a sheet of brass. It was relatively easy to generate the g-code for the individual parts using fusion360, but then it was a lot of faff to zero the machine such that it cut the part from a fresh part of the brass sheet without wasting too much metal in between the parts. It involved a lot of guesswork, and eyeballing. And even with that there was a lot of brass “wasted” between the parts especially since you could only move your part in x-y but not easily rotate it.

As a solution I wrote a python script which converted the g-code into svg, and a simple one page website where i could drag the svg around and rotate it on a visual representation of the sheet. Once i found a good safe spot for it to be cut the page told me the x,y, theta coordinates for it. And then with a separate python script i could transform the g-code using the coordinates and rotation. This way the svg renderer was doing the heavy lifting of visualising the cutting paths, and i only needed to concentrate on the relatively easy transforms.

thingsilearned 12/12/2025||
I love SVG! Recently I needed to render markdown in SVG and found no library existed for that yet so I released one:

github: https://github.com/davefowler/markdown-svg playground: https://markdown-svg-production.up.railway.app

notpushkin 12/12/2025|
I assume the goal is to get rid of all foreignObject uses eventually? (Otherwise it would be easier yo render one big foreignObject and convert everything to HTML)

Anyways, impressive, but what I’d really love to see is flexbox for SVG ;)

thingsilearned 12/17/2025||
Yeah, my use case would have required a heavy node or playwright import to convert the SVGs to other formats or show them correctly outside of browsers. This keeps it all SVG and it looks and feels good and lighter.
tracerbulletx 12/11/2025||
This feels a little bit like discovering frontend software development? I guess we're done with the trend of being scared of bundling features and running them in the browser close to the user with JavaScript.
xxmarkuski 12/11/2025||
I use ChatGPT to compress SVGs, in particular QR codes. Many QR code SVG generators produce inefficient SVGs, and conventional SVG compressors often lack the understanding required for some compression techniques. ChatGPT can replace alignment indicators with <use> elements.

Is there a way to embed the data encoded in the QR code directly within the image? This would allow the data to be parsed directly by the browser, eliminating the need for computer vision to decode it again. Going further, for web images QR codes could be efficiently encoded and rendered by the browser.

ktpsns 12/11/2025||
I am not sure about your use case. There exist many JS libraries which will generate client side QR codes. How many of them do you handle that you optimize for file size? Or is it just an academic interest?

SVGs are XML so technically, yes, you can just embed your visually encoded payload data with namespaces attributes and elements. If you don't want to use namespaces, you can use off-canvas texts, hidden/opacity=0 texts or even XML comments. You can even use the regular metadata section of SVGs. You can make the whole QR code within the SVG a clickable link.

paularmstrong 12/11/2025|||
> I use ChatGPT to compress SVGs, in particular QR codes

Why? svgomg.net exists, uses far fewer resources, and is going to give you much better results.

OuterVale 12/12/2025||
Heads up. The site you linked is just a wrapping of the original with adverts and tracking scripts. It isn't running the latest version either. Much better off using the creator's version.

https://jakearchibald.github.io/svgomg/

12345678UP 12/14/2025||
This was delightful. I would greatly enjoy seeing more use cases, as well as new editors, and new ways of working with SVG while keeping with it's capabilities and capacities.

Once I happened upon carto.net namely this: https://old.carto.net/papers/svg/samples/index.shtml#iact

I was absolutely sold on SVG.

now I find this: https://cartosvg.com/ which is mind blowing the capability and capacity, just the first example from link, really makes my day https://cartosvg.com/italia then the 2nd! It's compelling. I wish I could have built what i was trying to conceive building using OSC (Open Sound Control), but what i was setting out to do was ultimately brought into the world by Hexler's TouchOSC, i just wish somehow someone could have took VST to a unified front, and made it random controller populatable. impossible back then, yes. Today, different.

sbrother 12/12/2025||
I once built a music game that basically ran entirely on SVG. We hacked Musescore to attach the same UUID to both the note head in SVG and the MusicXML object in two different output modes, and then used that to synchronise the sheet music scrolling with a MIDI stream. If you're interested you can see it in action in our failed Kickstarter video from like eight years ago: https://www.youtube.com/watch?v=vgbB5Q4-dgY
absoluteunit1 12/11/2025||
I love working with SVGs.

We use SVGs on https://typequicker.com/press for the blog post hero images.

This way - even if the user changes themes, the colors of the image will be consistent with whatever theme is currently active. Also - the loading time is near-instant since we don't need to fetch the img file for the blog post image - just render the svg.

zajio1am 12/12/2025||
I notice one issue in SVG support in browsers that make it pretty unusable. When multiple polygons connect by edge, renderers alpha-blend their edges as if they are in general position, causing visible 'seam'. This is well-known problem in 2D graphics, usually handled by explicit selection of blending functions, but i cannot find anything about how to fix it in SVG.
ChrisMarshallNY 12/12/2025|
I remember an employee of mine, who was possibly the best engineer I ever knew, wrote up a specification document for his own vignetting algorithm, in Postscript.

The algorithm provided a 100X performance improvement over the classic Monte Carlo stuff that Tokyo had written.

The charts in the document were executable Postscript, running his algorithm.

That got the attention of the Ph.Ds in Tokyo. He was a high school-educated neurodivergent.

More comments...