Convert JPEG to SVG in Javascript

Can anyone help ... how to convert image to vectors (SVG) via Javascript .......! Any help would be awesome ....!

+6
javascript svg
source share
4 answers

Three options

Use the API for online conversion

http://apiv2.online-convert.com/

Launch your own node.js server and use Potrace or AutoTrace

https://www.npmjs.com/package/potrace used by online conversion https://www.npmjs.com/package/autotrace

Or use the client side imagetracerjs.

https://github.com/jankovicsandras/imagetracerjs

+11
source share

What you ask is actually impossible. I mean, you could try to do this, but I doubt that the results will be particularly satisfactory.

SVG to JPEG - one-way conversion; converting a bitmap to a vector image is nontrivial, see this question .

+1
source share

I was also looking for a simple conversion from image to svg - however it is not so simple, but I found a tool that could take simple images (black and white) and convert them to svg files, also the result was much better, because it somehow smooths the edges in a way - however, when trying with color images, this did not work. If you want to make simple images and then transform into svg, then using an online converter can help you

I used this to convert some simple .png images to .svg

http://image.online-convert.com/convert-to-svg

0
source share

This project supports both a raster image in SVG and SVG in a raster image (png / jpeg / gif / etc), offers flexible settings, various visualization tools, JavaScript API for node.js and a browser, and a command line.

When properly configured, it gives good results and a small SVG size. If you just want to transform logos / drawings, then no settings are needed, but if photos / realistic drawings, then you need to play with the settings until you are satisfied with the size / quality ratio.

https://www.npmjs.com/package/svg-png-converter

He has a playground, although now I'm working on the best one, as more functions have been added:

https://cancerberosgx.imtqy.com/demos/svg-png-converter/playground/#

0
source share

All Articles