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!
The SVG <image> element allows to include and render bitmaps within an SVG object. It can display image formats JPEG, PNG and the SVG pictures too.
Much like the img element in HTML SVG has an image element to serve the same purpose. You can use it to embed arbitrary raster (and vector) images. The specification requests applications to support at least PNG, JPEG and SVG format files.
You can't just save a PNG into an SVG file like when swapping between JPG and PNG. You will need to convert the raster image into a vector graphic, a process known as vectorization.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With