5 ms·
I recently learned an interesting little fact about Inkscape when looking for an SVG to PNG "converter". First, I knew that, in theory, SVG has a similar comple
by ahartmetz 4y ago
I recently learned an interesting little fact about Inkscape when looking for an SVG to PNG "converter". First, I knew that, in theory, SVG has a similar complexity to HTML. I didn't know that it is quite difficult to find a high quality standalone-ish (not and appendage of a HTML engine) renderer / engine for the format. Well, Inkscape has one of the most complete around, even implementing some not yet standardized features.
For reference: https://inkscape.org/develop/about-svg/ https://inkscape.org/develop/about-svg/ section "How does Inkscape implement SVG?"
- leeoniya 4y agoalso check out https://github.com/RazrFalcon/resvg https://github.com/RazrFalcon/resvg
- TillE 4y ago> with the goal to support the whole SVG spec. > resvg aims to only support the static SVG subset; i.e. no a, script, view or cursor elements, no events and no animations. Looks like a good library, but it's pretty funny that they had to walk that goal back because no, it's just not reasonable to support the whole stupid SVG spec.
- ahartmetz 4y agoFWIW, not supporting animations is very common. Most SVG files use SVG as a vector image format, and images in a strict sense don't move.
- vbezhenar 4y agoThis app works in production for me. It's good. Can recommend.
- hedgehog 4y agoOne less well known feature is the ability to query dimensions and render subsets of the SVG by element ID. That makes it possible to assemble say a drawing of some UI elements all together on one sheet that illustrates use and then programmatically extract bitmaps as needed for use in an app.
- thangalin 4y agoMy desktop text editor, KeenWrite[0], uses EchoSVG[1], which fixes numerous issues with Apache Batik[2]. KeenWrite takes SVG rasterization a little further by also making a text-to-diagram layer available. That is, text is transformed via Kroki[3] to SVG, then rasterized using EchoSVG. (Along the way, variables are interpolated and inserted, shown in the first screenshot.) [0]: https://github.com/DaveJarvis/keenwrite/blob/main/docs/screenshots.md https://github.com/DaveJarvis/keenwrite/blob/main/docs/scree... [1]: https://github.com/css4j/echosvg/ https://github.com/css4j/echosvg/ [2]: https://xmlgraphics.apache.org/batik/ https://xmlgraphics.apache.org/batik/ [3]: https://kroki.io/ https://kroki.io/
- yakubin 4y agoYou can also include JavaScript in SVG. That is used e.g. by the flamegraphs generated with Brendan Gregg’s Flamegraph.pl script. Consequently, when you open them in a classic image viewer, they’re static, but when you open them in a web browser, they’re interactive. I don’t think Inkscape supports JavaScript.
- hutzlibu 4y ago"I don’t think Inkscape supports JavaScript." It does, but only to attach it, not to run it in Inkscape as far as I know.
- cyann 4y agorsvg-convert from https://gitlab.gnome.org/GNOME/librsvg https://gitlab.gnome.org/GNOME/librsvg is what I use. They've been refactoring it in Rust for the last 5 years. It fit my needs, but I'm still trying to figure out how to get it to compile and get a fully static build.
- adzicg 4y agomaybe this will help - I pulled it together using instructions from Linux From Scratch, to build a static RSVG Convert that run run inside barebones AWS Linux 2 (on Lambda). https://github.com/serverlesspub/rsvg-convert-aws-lambda-binary https://github.com/serverlesspub/rsvg-convert-aws-lambda-bin...