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.
Inkscape has got an awesome auto-tracing tool.
sudo apt-get install inkscape
Check their tracing tutorial for more information.
Once you are comfortable with the tracing options. You can automate it by using CLI of Inkscape.
So you are looking for raster to vector graphics converter/tracer.
potrace
&autotrace
both are in Ubuntu repository. Myself I triedpotrace
before which gave nice results with default options. As I remember, both tools do not support compressed formats as input, only bitmap images.See Potrace examples
Potrace: utility to transform bitmaps into vector graphics
Command:
AutoTrace: bitmap to vector graphics converter
Command:
References:
man potrace
man autotrace
Update
There are more GUI that added tracing feature, like Gimp & Inkscape. See Hussein El Motayam's answer.
Here also Wikipedia: Comparison of raster-to-vector conversion software, not every tool. To anyone interested in comparing results, I would like to ask reporting results to free open source tools so they can ameliorate.
Use the
convert
command in the terminal :For example:
Here's some info from the manpage:
I just have used gimp right now with amazing results. I first used potrace but all I got was an image all in black with a lot of distortion. Maybe I didn't used it properly but when I tried with gimp just exporting as "eps" (file_name.eps), it was all done. All I have to do was review it setting the resolution with a value of 300. That's it.