Html Canvas Or Svg. Var svg documentquerySelectorsvg. If you care a lot about the flexibility and responsiveness of the graphic SVG is the way.
SVG images have some advantages over raster ones since you wont loose quality whatever the scale youll draw it on your canvas. In SVG each drawn shape is remembered as an object. HTML5 Canvas also helps in making 2D games.
It is a low level procedural model that updates a bitmap and does not have a built-in scene graph but through WebGL it allows 3D shapes and images to be displayed. In comparison Canvas was raw and pixel-based. By admin on Jan 30 2016 HTML5 canvas can be used to draw image from svg xml string using drawImage. The element is only a container for graphics.