How to convert an svg to a png (or gif) image?

306 views
Skip to first unread message

Mark

unread,
Aug 3, 2023, 7:18:48 AM8/3/23
to golang-nuts
I know this has been asked before, just wondered if there were any pure-Go solutions?

Mohamed Attahri

unread,
Aug 3, 2023, 2:57:07 PM8/3/23
to Mark, golang-nuts
I’d be very surprised if there was. I don’t see why anyone would commit the insane amount of resources to build an SVG pipeline for anything other than a browser or a graphics editor.

Your best bet is to interface with a command line tool (e.g. imagemagik) using stdin and stdout. 

On Aug 3, 2023, at 7:19 AM, 'Mark' via golang-nuts <golan...@googlegroups.com> wrote:


I know this has been asked before, just wondered if there were any pure-Go solutions?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e8a39bee-742a-4491-809a-b2230ef8ea26n%40googlegroups.com.

Tamás Gulácsi

unread,
Aug 4, 2023, 3:46:18 AM8/4/23
to golang-nuts

Mark

unread,
Aug 4, 2023, 4:48:26 AM8/4/23
to golang-nuts
Thanks!

Mandolyte

unread,
Aug 4, 2023, 6:58:19 AM8/4/23
to golang-nuts

Brian Candler

unread,
Aug 4, 2023, 7:21:51 AM8/4/23
to golang-nuts
Also there's a project which compiles C code to Go - ISTR it was used to build a pure Go version of Sqlite.  Presumably the same approach could be applied to an image processing library.

Jan Mercl

unread,
Aug 4, 2023, 10:45:31 AM8/4/23
to Brian Candler, golang-nuts
On Fri, Aug 4, 2023 at 1:22 PM Brian Candler <b.ca...@pobox.com> wrote:

> Also there's a project which compiles C code to Go - ISTR it was used to build a pure Go version of Sqlite. Presumably the same approach could be applied to an image processing library.
>
> https://twitter.com/bradfitz/status/855271867162083329?lang=en
> https://groups.google.com/g/golang-nuts/c/QDEczMhlQBU/m/4lCn2kP0AwAJ
> https://github.com/elliotchance/c2go

ccgo/v3 is being slowly phased out. ccgo/v4 is not yet released, but
maybe it can already transpile a C SVG to PNG code base and I'd like
to try that to at least know where it fails.

A quick search found no such C code, but that might be my fault. Does
anyone know about a pure C SVG to PNG lib/program?

-j
Reply all
Reply to author
Forward
0 new messages