Is an SVG image purely vectorial or can we combine bitmap images into an SVG image ?
How about transforms applied on the bitmap images (perspective, mappings, etc.) ?
Edit: Images may be included in an SVG by link reference. See http://www.w3.org/TR/SVG/struct.html#ImageElement. My question was in fact if bitmap images may be included inside the svg so that the svg image would be self contained. Otherwise, whenever the svg image is displayed the link must be followed and the image downloaded. Apparently .svg files are simply xml files.
Yes, you can reference any image from the
imageelement. And you can use data URIs to make the SVG self-contained. An example:The
svgelement attributexmlns:xlinkdeclaresxlinkas a namespace prefix and says where the definition is. That then allows the SVG reader to know whatxlink:hrefmeans.The
IMAGE_DATAis where you’d add the image data as base64-encoded text. Vector graphics editors that support SVG usually have an option for saving with images embedded. Otherwise there are plenty of tools around for encoding a byte stream to and from base64.Here’s a full example from the SVG testsuite.