I'd like to be able to crop SVG chemical structures, completely (see this question), that were created using MarvinSketch and I think I might have thought of a solution; I use MarvinSketch to create a large PNG file, then crop that using GIMP, and then convert the PNG to SVG. Hence I'd like to know if anybody knows a free software I can install (I don't like using online converters as I'm always suspicious of malware) on Ubuntu for high quality PNG->SVG conversion.
|
So you are looking for raster to vector graphics converter. See Potrace examples Potrace: utility to transform bitmaps into vector graphics
Command:
AutoTrace: bitmap to vector graphics converter
Command:
References:
|
|||||||||||||||||||||
|
|
Inkscape has got an awesome auto-tracing tool.
Check their tracing tutorial for more information. Once you are comfortable with the tracing options. You can automate it by using CLI of Inkscape. |
|||||||||
|
`#{INKSCAPE_PATH} -z -f #{Guanidine.png} -w #{width} -j -e #{Guanidine.svg}– BH2017 May 22 '14 at 7:31cd ~/Documents/Chem Structures/which is the directory in which the files are. – BH2017 May 22 '14 at 7:34echo "$picture" | sed 's/\.\w*$/.png/'/usr/bin/convert "$picture" png:"$png_file" shift done in ~/.local/share/nautilus/scripts and remember to make it executable then just right click then scrips then what ever you save this script under – zeitue May 22 '14 at 7:35sudo apt-get install imagemagick– BH2017 May 22 '14 at 7:37convertcommand is even worse: It places a circle for every pixel of the pixel graphics, what leads to very large file sizes. I'd therefore try to directly cut the SVG file. – soulsource May 22 '14 at 13:37