summaryrefslogtreecommitdiff
path: root/content/posts
diff options
context:
space:
mode:
authorclaw0ry <me@claw0ry.net>2024-12-12 10:42:48 +0100
committerclaw0ry <me@claw0ry.net>2024-12-12 10:42:48 +0100
commit7f941e93281e93942988e0ddc63d071064528c2a (patch)
tree1da3a7347082496826bd3f8407c73098c4e2e6fc /content/posts
parentfresh start (diff)
new post about converting svg to png
Diffstat (limited to 'content/posts')
-rw-r--r--content/posts/convert-svg-to-png.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/posts/convert-svg-to-png.md b/content/posts/convert-svg-to-png.md
new file mode 100644
index 0000000..220102a
--- /dev/null
+++ b/content/posts/convert-svg-to-png.md
@@ -0,0 +1,24 @@
+---
+title: 'Convert SVG to PNG'
+description: 'How to convert SVG to PNG from the commandline'
+date: '2024-12-12'
+tags: ['png', 'svg', 'cli']
+---
+
+Today I was going to pick-up an order and to my dissapointment the store sent me a QR-code that I needed to bring for them to hand out my order. Usually you get a simple code. For most people this is not a problem tho, but I have started to use a dumbphone. So, then I have to bring my smartphone (which has no internet access on the go) with the QR as an image. An important details is that the image was in SVG format. To my surprise my smartphone (a Pixel 8a) does not support displaying SVG images locally, so I had to convert it to PNG.
+
+<!--more-->
+
+My first go-to is [ImageMagick](https://imagemagick.org/script/index.php) which is a powerfull image converter/manipulator tool. The problem with ImageMagic was that when I wanted to scale the image to a larger size than the original SVG (300x300), it got all blurry.
+
+I needed a larger size because the 300x300 image got blurry on my phone. I wanted it to be atleast 1024x1024.
+
+I went looking for alternatives and found this [StackOverflow answer](https://stackoverflow.com/a/14174624) which suggest using `inkscape`.
+
+The command suggested worked perfectly. My image got as clear as it could be.
+
+```
+inkscape -w 1024 -h 1024 input.svg -o output.png
+```
+
+The power of Inkscape continues to amaze me!