Xfce Forum

Sub domains
 

You are not logged in.

#1 2026-04-07 02:05:10

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Render SVGs as PNGs, natively

Is there a way to render SVGs as PNGs on user-friendly gnu-linux distros without installing another program. I know inkscape can render svg but almost no distros provide inkscape out of the box.

Is there some command that I've missed with 'apropos' searches?

I know that individual programs can render svgs. like a file manager for example, and it is maybe possible to arrange a hack that takes a screenshot of the svg from that third program. But that isn't the sort of thing I'm looking for. Such a hack would be dangerous, and fail to create PNGs with transparency.

I sense the answer is going to be so in-my-face common that noone bothers to even ask, lol

Thanks in advance

Last edited by organicode (2026-04-26 18:26:59)

Offline

#2 2026-04-07 10:24:38

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 962
LinuxFirefox 149.0

Re: Render SVGs as PNGs, natively

A distro would have t come with Inkscape or some sort of image manipulation program by default. I don't know of one off hand but I'm sure they exist. A big one that would be likely is Gimp.
For changing image formats myself I use convert. It's part of the imagemagick package. It will convert just about any format into another format.

Description: image manipulation programs -- binaries
ImageMagick is a software suite to create, edit, and compose bitmap images.
It can read, convert and write images in a variety of formats (over 100)
including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript,
SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale,
shear and transform images, adjust image colors, apply various special
effects, or draw text, lines, polygons, ellipses and Bézier curves.
All manipulations can be achieved through shell commands as well as through
an X11 graphical interface (display).


But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell

Offline

#3 2026-04-07 12:26:32

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 172
LinuxFirefox 145.0

Re: Render SVGs as PNGs, natively

It might not be a “native” app, but “Converseen” is a superb (and easy) tool for graphic conversions – try it...


The main defect of the linuxers is lack of memory - they don't remember how their knowledge was when they started with the linux

Offline

#4 2026-04-12 03:58:30

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

Thanks Peter and Erie!

eriefisher wrote:

imagemagick

Yep, this sounds very promising I remember seeing it around. COMPLETELY forgot about it. Thanks!

Offline

#5 2026-04-19 05:46:45

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

For the record (because imagemagick doesn't document this without its 'doc' package), if you want the PNGs to render properly from SVG with an alpha channel for transparency, use -background none.

magick -background none existing-file.svg new-file.png

Added later 16 min 39 s:
Other examples of what imagemagick can do... not related strictly to SVG but might be of interest to anyone who opens this thread. Also, the "Masking Method Differences" part on this page is pretty compelling, and not simple to write as a command. Really sorry for posting the above links to imagemagick site. After a quick networks check I found that the site contains a bunch of goog, microslop and cloudflare fetches/trackers. It gets worse...

Last edited by organicode (2026-04-26 18:07:03)

Offline

#6 2026-04-26 18:08:03

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

Discovered that ImageMagick can't load svg at different sizes. They say the inkscape renderer is the culprit [ARCHIVE.ORG LINK (to avoid goog, microslop etc)] (see SVG section, '-size' note) but I have inkscape and their 'size' option works fine.

No longer marking as 'solved' because I'm back on the hunt for a native (gnu/linux) svg renderer again. Its totally possible there are none. Will explore trying to switch off the inkscape renderer in ImageMagick...

Will report back if/when success.

Last edited by organicode (2026-04-26 22:55:54)

Offline

#7 2026-04-26 19:13:17

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 962
AndroidChrome 147.0

Re: Render SVGs as PNGs, natively

The Gimp is the only other thing that come to mind. It does just about anything image related.


But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell

Offline

#8 2026-04-26 19:17:49

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,591
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

Have you had a look at rsvg-convert? It should be installed by default on most distros and is lightweight. It supports resizing by width x height, dpi, and zoom. Transparent backgrounds are the default.

man rsvg-convert

Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2026-04-26 23:03:51

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

The search function on the above ImageMagick website (that leaks data to digital predators) doesn't work, I just get the website's landing page spat back at me. How kind of them.

ToZ wrote:

(...) rsvg-convert (...)

Now THIS is extremely compelling, I have no idea why my searches never found this. Will check the other PC when I return to headqurters (still no internet there, lol)

Thanks for the GIMP suggest, eriefisher. GIMP is great but isn't native to (essentially all) gnu/linuxs. Really looking for somthing that everyone will have.

Offline

#10 2026-04-27 00:58:40

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 962
AndroidChrome 147.0

Re: Render SVGs as PNGs, natively

The Gimp may not be installed by default but it's definitely available in all Linux distro. It is big so most distros don't put it on the install image. It built specifically for *nix's and the foundation for Gnome/GTK.


But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell

Offline

#11 2026-04-27 04:18:59

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

eriefisher wrote:

The Gimp may not be installed by default but it's definitely available

Yes, maybe instead of "native" I should have said "bundled" or "installed by default". Thanks

Really looking forward to testing `rsvg-convert` big_smile

Offline

#12 2026-05-02 21:40:57

organicode
Member
Registered: 2026-04-01
Posts: 20
LinuxFirefox 140.0

Re: Render SVGs as PNGs, natively

UPDATE re 'rsvg-convert':

Tis a great suggestion, thanks again ToZ. Though it *appears* to be installed on Manjaro by default (an Archlinux-based distro), via the package 'librsvg', it is unfortunately ***not*** installed by default on Trisquel (an Ubuntu/Debian-based distro), via a package 'librsvg2-bin'.

Please tell me if you think I am mistaken but this is probably not a solvable thread (in the short term) if Trisquel's forums were accessible I might be able to convince them to include this basic svg converter by default but such is life.

Thanks all for the exploration.

EDIT: This was a larger post about another package, until I double checked and found that I had not searched properly.

Last edited by organicode (2026-05-02 22:02:02)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] CCBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.006 seconds, 8 queries executed - Memory usage: 582.59 KiB (Peak: 599.56 KiB) ]