How to convert a jpeg image to an svg in octave? -


i have black n white image first convert png transparent background such black part of image remains. using output image want convert svg. of through code can connected back-end of server. how can achieve this?

i not work, may started. suggest imagemagick , potrace both of free , available os x, linux , windows. can integrate them php , run them library functions, now, using terminal/commandline.

let's start making chessboard image imagemagick

convert -size 200x100 pattern:checkerboard chess.jpg 

enter image description here

we can threshold make pure black , white, this:

convert chess.jpg -threshold 50% chessbw.jpg 

enter image description here

then want send potrace make svg, needs pbm format file, convert pbm this:

convert chess.jpg -threshold 50% chessbw.pbm 

now tell potrace convert svg

potrace -b svg chessbw.pbm -o result.svg 

but not easy see, imagemagick convert result.svg jpeg red background can see transparent areas:

convert -background red result.svg result.jpg 

enter image description here

ok, more of explanation simple answer, simplify down 1 command whole lot:

convert chess.jpg -threshold 50% pbm:- | potrace -b svg - -o result.svg 

i hope helps.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -