Skip to content

59naga/pixel-to-svg

Repository files navigation

PixelToSvg NPM version Build Status Coverage Status Climate Status

Sauce Test Status

ImageData to SVG <path> elements

DEMO

Installation

$ npm install pixel-to-svg --save

API

svg.convert(imageData) -> svgHTML

var pixel= require('pixel');
var svg= require('pixel-to-svg');
pixel.parse('https://cdn.rawgit.com/59naga/pixel-to-svg/master/test/10x10.png')
.then(function(images){
  console.log(svg.convert(images[0]));
});
// <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" shape-rendering="crispEdges" width="10" height="10" viewBox="0 0 10 10"><g><path fill="rgba(0,0,0,255)" d="M0,0h10v10h-10Z"/></g></svg>

Related projects

License

MIT

Releases

No releases published

Packages

No packages published