Autotrace and other SVG to SIF converters

Autotrace is a program that can convert BMP files into SVG files. I thought it might be possible to write an export filter to output SIF files instead.
I have the basic mechanics working so far. The basic ducks are in the right places, but something isn’t working quite right with the tangents. Apart from the fact that they’re attached to the wrong ducks (my initial poor understanding of how SVG worked) they don’t appear to be in quite the right place. Next step - print out all the values and crank through the algorithm by hand. :frowning:

Given a bitmap that looks like this

Autotrace gives

and my sif export gives

Spurred on by dmd, I made some good progress tonight.

For simplicity I chose not to split the tangents. Now I have to figure out how to deal with split tangents - awkward when the svg spec associates one half of a tangent with the start point, and the other half with the end point. Synfig associates both with the same point.

No changes to the code, but a better example.

Base image scanned in from a sketch

Same image recognized by autotrace (with centerline option) and exported to svg (rendered by inkscape)

Same image recognized by autotrace and exported to sif (rendered by Synfig of course)

Edit - and just for grins - I took the svg centerline version, and used dmd’s xsl transform to make a sif. Somewhere along the way we’re not handling the pen move correctly. Here’s the result.

Edit 5/14/08 - here’s the same svg file run through akagogo’s converter -

It needs some adjustments with the widths, but WOW! :open_mouth:

Oh, it can export to sif? Wow, great. And I really like the sif version with the different width. (althought I guess it could be done in the “single center line” way too)

Interesting! I thought that autotrace is abandoned for a long time? Would you like to maintain it, pixelgeek?

Since i use Inkscape quite often, i am more familiar with potrace. potrace.sourceforge.net/samples.html

When you have already your graphics in a vector format like Svg or Eps, you can convert it easily with pstoedit into almost every vector format. (But not yet sif. Hint) :slight_smile:
pstoedit.net/pstoedit

I looked at potrace and autotrace. I found the autotrace code simpler and easier to edit and compile. Admittedly, I didn’t look that hard. It was more of a proof of concept - see how far I could stretch my meager C coding skills.

Akagogo has a standalone converter that seems to give very good results. Maybe one day it can be incorporated into Synfig.

I’m on the edge of my seat with this topic. I’m new here and about to sink my teeth into Synfig. I use Inkscape everyday for my work and have accumulated quite a lot of art in svg that I will eventually animate. I’d sure like to know what the best method is to convert to sif under linux.

I’ve been most impressed by Akagogo’s converter so far out to the few choices we have. However, you’d have to get the source from him and compile it yourself :frowning: I think (hope) he’s still working on it.
The XML converter on the wiki is the only released one that I’m aware of, and as you can see, it has some limitations… They all do right now.

Chris

Hi all !

I will to try Akagogo converter but it segfault ?
I have compiled it on Debian Lenny Testing , someone have the same problem ?

vgtosif[8542]: segfault at bff14000 ip b7cc3828 sp bff11f18 error 6 in libc-2.7.so[b7c4d000+155000]
[28714.605162] svgtosif[8576]: segfault at bfd6e000 ip b7d1c828 sp bfd6c598 error 6 in libc-2.7.so[b7ca6000+155000]
[29280.668036] svgtosif[10213]: segfault at bfc47000 ip b7cf5828 sp bfc45c68 error 6 in libc-2.7.so[b7c7f000+155000]
[29431.010962] svgtosif[14800]: segfault at bf824000 ip b7cd3828 sp bf821048 error 6 in libc-2.7.so[b7c5d000+155000]
[29478.480362] svgtosif[14842]: segfault at bfad6000 ip b7d85828 sp bfad3308 error 6 in libc-2.7.so[b7d0f000+155000]
[29586.529619] svgtosif[14858]: segfault at bfda6000 ip b7d54828 sp bfda45c8 error 6 in libc-2.7.so[b7cde000+155000]
[29673.261516] svgtosif[14879]: segfault at bfeb3000 ip b7d62828 sp bfeb0668 error 6 in libc-2.7.so[b7cec000+155000]
[29993.077780] svgtosif[15642]: segfault at bfea7000 i

svgtosif test.svg
input : data/test.svg
output: data/test.sif
Erreur de segmentation

I have try with the bash script provide on the synfig.org/Svg2synfig
but same result !

Thanks for reply.
:wink: