7

Possible Duplicate:
Does SVG support embedding of bitmap images ?

I'm trying to insert PNG images into SVG file. If I use <image> tag I can only set references to PNG images. I wan't to put whole PNG data into SVG, because if PNG file will be moved or deleted, my SVG file should still be rendered with those PNG data.

Is it possible with SVG format?

Thank you in advance!

Community
  • 1
  • 1
Lukasz Spas
  • 595
  • 2
  • 9
  • 23

1 Answers1

6

There are 2 ways to reference images in SVG you can reference an external source which is "dangerous" because the external resources might become unavailable and the second way is to embed the 64 bit encode of the image directly into the SVG which is what you probably want

There are online tools to convert images to 64 bit encoding When you get these strings you plonk them into the correct tag

I think Inkscape gives an option to load an image in both ways so you won't have to use the online conversion tools.

Chasbeen
  • 1,448
  • 12
  • 17
  • 10
    "64 bit encode" perhaps you meant "Base64 encode". – GusOst Nov 11 '13 at 19:40
  • http://tutorials.jenkov.com/svg/image-element.html#svg-image-example – Julian Oct 30 '15 at 18:30
  • 1
    @GusOst He probably means to use data URLs, in that case they don't necessarily need to be Base64 encoded, one can use any encoding the data URLs support – Vad Dec 17 '16 at 13:12