How to convert all SVGs in a folder to PNG with Docker image?

I recently stumbled across this simple problem and realized, that I actually don’t want to install any app like Inkscape just to do that. Came across this nice and simple docker image

Here’s how I used it. First, I tried to run it against a single file to see if that works at all:

 docker run --rm -v `pwd`:/svg burke/svg2png "Logo.svg" -w 256

Surely enough, it worked and generated me Logo-w256.png. I went further then and converted all the SVGs in a folder to PNGs:

for i in *.svg; do docker run --rm -v `pwd`:/svg burke/svg2png "$i" -w 256; done

And it worked again! Now, you could combine it with FFMpeg and generate WEBPs as well.

Did you know that I made an in-browser image converter, where you can convert your images without uploading them anywhere? Try it out and let me know what you think. It's free.

Leave a Comment

Your email address will not be published. Required fields are marked *