I had a small tool to convert PNG to SVG in Python. Someone contributed Rust code to it, and I ended up rewriting the whole thing to improve performance and as a learning exercise

102 points mayuso_dev 9 comments

I just wanted to share this tool I’ve been working on called PNGToSVG. As I assume you can already imagine, it converts PNG images into SVG vectors.

PNGToSVG in GitHub

I originally wrote a small Python script to be used for a frontend job I had in 2019, sometimes we were required to work with SVG, and I just needed a quick way to convert images without uploading them to any remote service.

When I switched jobs, I took that code, uploaded it to GitHub and didn't think about it too much. 5 years later, someone ("Kartik Nayak" on GitHub) made the first Rust implementation of the tool. 3 months later someone else ("Salman Sali" on GitHub) improved the code by including parallelization.

This was in late 2024. Since then, I have learnt a bit of Rust, polished the tool, and published a couple new releases, mainly focusing on ease of use and performance. Yesterday, I did the latest release (v0.6.1) which included an amazing programmer art new shiny icon hahaha.

What in 2019 was a forgotten Python script on my hard drive is now a tool I actively use for my projects, I used to convert 64x64 or 128x128 icons to SVG in a couple seconds, it can now convert 8000x8000 images in a fraction of that time. According to my quick benchmarks, the performance increase in my machine of the latest release compared to the first version I shared in Python in 2019 is around 2580x.

And that's not even the best part, thanks to randomly deciding to share a quick script I have been able to see very useful contributions to my code from the community, learn a complete new language, and actually build an easy to use tool I am actually willing to use myself.

I'd love to hear some constructive feedback. I am sure I can still improve some rough edges, as I still don't fully know Rust conventions, and I'd love to learn as much as possible while building something useful.