Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting a data URI back to SVG

Tags:

svg

data-uri

Might be a silly question but is it possible to convert a data URI back to SVG? I've Googled & searched SO and found nothing on the subject, loads of stuff on the other way round of course.

Thanks!

Edit: sorry should've been more specific - a data:image like this:

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MCA4MCI+PHBhdGggZmlsbD0iIzFBMzc2MSIgZD0iTTE3Ljc4IDI1LjY1Yy44OS0uODkgMi4zNS0uODkgMy4yNSAwTDQwIDQ0LjU5bDE4Ljk3LTE4Ljk1Yy44OS0uODkgMi4zNS0uODkgMy4yNCAwbDIuNDMgMi40M2MuODkuODkuODkgMi4zNSAwIDMuMjVMNDEuNjIgNTQuMzVjLS45Ljg5LTIuMzUuODktMy4yNSAwTDE1LjM1IDMxLjMzYy0uODktLjg5LS44OS0yLjM1IDAtMy4yNWwyLjQzLTIuNDN6Ii8+PC9zdmc+

like image 635
Ali Green Avatar asked Oct 06 '15 10:10

Ali Green


People also ask

How do I decode an SVG file?

You can copy/paste the string ( data:image etc included) in the url bar of a modern browser; it will decrypt it for you, then you can simply save the page as an svg.

Can all images be converted to svg?

Absolutely. Upload any JPG image from your desktop or mobile device to convert to an SVG file. Can a PNG be converted to SVG? Yes, our SVG converter can also convert PNG images.


2 Answers

  1. View the data URI in a web browser
  2. Use inspect element
  3. Open the data URI in new browser window/tab
  4. Save the image as an .svg file
like image 85
holas Avatar answered Sep 28 '22 06:09

holas


I am going to assume you mean a Base64 encoded data URI.

The answer is yes. The URI will look something like:

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0c... 

The Base64 part is the part that starts with PH. Copy that part into an online converter such as this one.

like image 30
Paul LeBeau Avatar answered Sep 28 '22 07:09

Paul LeBeau