From 707393c81015644522cc79b3917d62ffad47923c Mon Sep 17 00:00:00 2001 From: Riesi Date: Mon, 19 Aug 2019 22:00:28 +0200 Subject: [PATCH] =?UTF-8?q?[util]=20a=20python=20was=20found=20in=20the=20?= =?UTF-8?q?pond=20=F0=9F=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it seems to be friendly towards frogs --- gen_png.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gen_png.py diff --git a/gen_png.py b/gen_png.py new file mode 100644 index 0000000..bde173e --- /dev/null +++ b/gen_png.py @@ -0,0 +1,12 @@ + +import glob +import ntpath +import subprocess + +files = [f for f in glob.glob("./**/*.svg", recursive=True)] +sizes = [16, 32, 64, 128, 256, 512, 1024, 4096] + +for f in files: + name = ntpath.basename(f).replace(".svg", "") + for s in sizes: + subprocess.run(["inkscape", "-z", "-C", "-w", str(s), "-e", "./png/"+str(s)+"/"+name+".png", "-f", f])