SVGs not importing properly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EmeraldSlash

I’m trying to import an SVG into Godot Engine.

Currently, for some reason, the SVG imports (and shows up in the resource browser) as a 1x1 brown texture: Screenshot by Lightshot

What it should look like: Screenshot by Lightshot

Changing the scale only works on certain types of exports (I’m using Affinity Designer to make the SVGs, and there are around 4 different export options - print, web, flatten, etc.), and only seems to work up to around 40x40 - no use when my image is 1920x1080.

Anyone got any ideas why this is? Should I just use PNGs instead?

Thanks

:bust_in_silhouette: Reply From: koigx

I would suggest using png instead – other formats are iffy.

:bust_in_silhouette: Reply From: Calinou

SVG rasterization in Godot relies on the nanosvg library, which is small and does not implement the full SVG 1.1 specification. The SVG specification is huge; no small, permissively-licensed library supports it fully.

Except for very simple vectors, it is suggested to render PNGs using vector software instead. This process can be automated using scripts; for example, Inkscape offers CLI functionality for exporting vectors to various image formats.