Our great sponsors
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
resvg
-
png crate gets an ultrafast compression mode, up to 4x faster decompression
For example, when converting vector SVG images to raster PNG images with resvg, most of the time is spent compressing the PNG image. This is a lot of wasted work if we just want to read the image instead of transferring it over the network! The fast compression mode eliminates all this wasted work, resulting in huge performance and efficiency gains.
-
Is coding in Rust as bad as in C++? A practical comparison
Just as a point of reference, I have a ~75KLOC project (includes dependencies) called resvg which takes just 4s in the debug mode and 8s in the release mode to build on M1 Pro.
- Forma: An efficient vector-graphics renderer
- Inkscape 1.2.2 Released
-
Good example of high performance Rust project without unsafe code?
resvg is very fast, although the performance depends on the exact SVG you feed it - sometimes faster than librsvg, sometimes slower (although librsvg is also written in Rust now, it does use unsafe while resvg doesn't)
-
I think more Rust devs should focus more on rewriting software that is prone to exploitation
So, all you gotta do is rewrite the parsers. Funny you mention librsvg because there is a library called resvg that has a thumbnailer implementation for Windows Explorer. https://github.com/RazrFalcon/resvg
-
A challenger to the throne of vector graphics. SVG is dead, long live TinyVG
A small nitpick as the resvg author: the repo located here https://github.com/RazrFalcon/resvg I'm not sure why the author linked some random, outdated fork. If you're trying to beat SVG, you should have done a better research.
But yes, SVG is extremely bloated and under-documented. Especially SVG 2. The core resvg codebase is close to 20 KLOC, while the whole package is like 50 KLOC.
On the other hand, resvg is an exception, because it doesn't rely on any system and/or 3rd party libraries. 95% of the code in the final binary was written by one person (me). Not because it was strictly required, but because it was fun. resvg is basically an epitome of RIIR.
>How much work would it be to port over the C# SVG→TinyVG converter to Rust based on resvg?
Probably a day, as long as you know Rust. I can take a look into it if you're interested. usvg (the SVG parser of resvg) is specifically designed to convert a real world SVG with all its quirks into a machine readable, minimal SVG/XML.
One thing to note is that usvg doesn't preserve text at the moment (will be converted into paths automatically) and Quadratic curves.
PS: I also have a longer, but still unfinished rant [0] over SVG complexity if you're interested.
[0] https://github.com/RazrFalcon/resvg/blob/master/docs/renderi...
- E-Ink Magic Calendar that runs off a battery powered Raspberry Pi
-
Compile time
As an example/proof, resvg contains close to 100KLOC (including all dependencies) and compiles in 13s on Apple M1 (clean release build).
lib2geom
-
Essential SVG tools
If you're building an app that needs to perform fast and accurate 2d computational geometry (boolean operations and way way more) you'll end up grateful for Nathan Hurst and all other contributors who made lib2geom possible. Fun fact, Inkscape uses 2geom under the hood and also powers the amazing live path effects etc.
What are some alternatives?
egui - egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
canvas2svg - Translates HTML5 Canvas draw commands to SVG
svgomg - Web GUI for SVGO
vtracer - Raster to Vector Graphics Converter
bevy - A refreshingly simple data-driven game engine built in Rust
rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266
iconvg - IconVG is a compact, binary format for simple vector graphics: icons, logos, glyphs and emoji.
mold - Mold: A Modern Linker 🦠
cargo-bloat - Find out what takes most of the space in your executable.
rust - Empowering everyone to build reliable and efficient software.
oculante - A minimalistic crossplatform image viewer written in rust