Drawing icons and logos (SVG Paths to PNG with Go) #914
jaller94
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This goes out to everyone who wants to generate icons, logos or other symbols. Using Go, you can render SVG paths.
Using https://github.com/tdewolff/canvas you can render the path to a canvas which can be exported to a PNG file.
Here's the script that generates an image. You'll need to adapt it, if you want it to draw your own shapes.
https://hub.windmill.dev/scripts/helper/1437/svg-path-to-png-helper#193
The script generates the following triangle. The PNG binary data is returned as a base64-encoded string.
Beta Was this translation helpful? Give feedback.
All reactions