Conversion of SVG paths

Orginal Path

Relative Path

Absolute Path

Conversion of Absolute SVG paths to Relative SVG Paths Example

var paths = document.querySelectorAll("#tiger path");

for(var i = 0; i < paths.length; i++) {
	if(paths[i].getAttribute("d")) {
		var relative = SvgPaths(paths[i].getAttribute("d"), "relative"),
			absolute = SvgPaths(paths[i].getAttribute("d"), "absolute");
	
		if(absolute != paths[i].getAttribute("d"))
			console.log(paths[i].getAttribute("d"), "|", absolute);
	
		paths[i].setAttribute("d", relative);
	}
}