HTML SVG Loading

I’m not really sure how to explain this, but I’ll give it a shot.

I have a URL that has a SVG file on it, and want to load it in and display it in my project.

Something like:

PShape costume;
costume = loadShape("");

The issue is that the URL has the SVG file in the format of a HTML document, and I don’t know If its possible to load it in or not. Is there any way to do this?

EDIT: I think it’s actually XML, not 100% sure what that is…

1 Like

looks for me like a good SVG
should not be a problem

but it says here ( RPI / Raspbian / Processing 3.4 / JAVA mode )
using the

Unsupported format:

here looks better

but saving the content to a local svg file OK

PShape bot;

void setup() {
  size(500, 500);
  //  bot = loadShape("");
  bot = loadShape("data/mitsvg.svg");

void draw() {
  shape(bot, 0, 0);


Thank you so much! I’ll be sure to try that.

I was looking at your code, and wondered if there was anyway that the file could be downloaded and saved to the computer all in the project instead of being done manually before hand.

?? that question i not understand

but i did a test and uploaded it to my blog and loaded it from there

  bot = loadShape("");

and it works,
( but i can not be your file server… )

so i think there might be a problem about the


Sure – you can use

  1. loadXML to get the svg file from a url, then
  2. saveXML to save it to your sketch folder, then
  3. loadShape to load the local SVG file as a PShape.