Synfig Project Forum

Forums for Synfig Project
It is currently Thu Sep 02, 2010 3:25 pm

All times are UTC - 4 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Autotrace and other SVG to SIF converters
PostPosted: Mon Dec 24, 2007 12:41 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 7:23 pm
Posts: 602
Location: West Coast USA
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. :(

Given a bitmap that looks like this
Image

Autotrace gives
Image

and my sif export gives
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 1:24 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 7:23 pm
Posts: 602
Location: West Coast USA
Spurred on by dmd, I made some good progress tonight.

Image

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.


Top
 Profile  
 
 Post subject: Re: Autotrace
PostPosted: Thu Mar 27, 2008 2:06 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 7:23 pm
Posts: 602
Location: West Coast USA
No changes to the code, but a better example.

Base image scanned in from a sketch
Image

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

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

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.
Image

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


Top
 Profile  
 
 Post subject: Re: Autotrace
PostPosted: Thu Mar 27, 2008 2:58 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 6:26 am
Posts: 1789
Location: Spain
It needs some adjustments with the widths, but WOW! :shock:

_________________
Synfig needs your help!
Developers, packagers, bug testers, translators, artists, web developers, wiki writers... you can contribute! :D


Top
 Profile  
 
 Post subject: Re: Autotrace
PostPosted: Fri Mar 28, 2008 7:14 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 6:28 am
Posts: 67
Location: France
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)

_________________
http://aurore.d.googlepages.com/synfig


Top
 Profile  
 
 Post subject: Re: Autotrace
PostPosted: Tue May 13, 2008 9:28 am 
Offline
User avatar

Joined: Sun Apr 27, 2008 4:54 pm
Posts: 27
Location: United europe
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. http://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) :)
http://www.pstoedit.net/pstoedit


Top
 Profile  
 
 Post subject: Re: Autotrace
PostPosted: Tue May 13, 2008 7:08 pm 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 7:23 pm
Posts: 602
Location: West Coast USA
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.


Top
 Profile  
 
 Post subject: Re: Autotrace and other SVG to SIF converters
PostPosted: Fri Jun 27, 2008 12:04 pm 
Offline
User avatar

Joined: Wed Jun 25, 2008 6:47 pm
Posts: 8
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.


Top
 Profile  
 
 Post subject: Re: Autotrace and other SVG to SIF converters
PostPosted: Mon Jun 30, 2008 2:27 am 
Offline
Site Admin
User avatar

Joined: Sat Dec 01, 2007 7:23 pm
Posts: 602
Location: West Coast USA
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 :( 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


Top
 Profile  
 
 Post subject: Re: Autotrace and other SVG to SIF converters
PostPosted: Fri Nov 14, 2008 7:28 pm 
Offline

Joined: Fri Nov 14, 2008 7:22 pm
Posts: 2
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 http://synfig.org/Svg2synfig
but same result !

Thanks for reply.
:wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 4 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group