LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-30-2012, 04:31 AM   #1
laulau
LQ Newbie
 
Registered: Mar 2012
Posts: 3

Rep: Reputation: Disabled
Question autotrace batch processing


Hi.

I have been using

Code:
autotrace input.png --output-file output.svg
to convert single .png to .svg

how do I convert more than one file at the time? I have 200 .png in one folder that I want to convert to .svg.


Lars

Last edited by colucix; 03-31-2012 at 02:44 AM. Reason: Moderator note: removed advertising of personal blog (not allowed at LQ).
 
Old 04-01-2012, 07:40 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Should be quite easy:

Code:
for i in *.png; do
autotrace "$i" --output-file "$(echo $i | sed 's/.png/.svg/')"
done
That will take all the files in the current directory (e.g. 1.png, foo.png, bah.png) and convert them to .svg (writing them to 1.svg, foo.svg and bah.svg respectively)

Hope this helps,
 
Old 04-01-2012, 03:43 PM   #3
laulau
LQ Newbie
 
Registered: Mar 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Talking

thank you Snark1994!

It worked fine.

I am new to the command line, but I shall get into it more when I have some time.

I am using it as an "effect" on a video, like this:

Code:
ffmpeg -i fro.avi image%d.png
Code:
for i in *.png; do autotrace "$i" -despeckle-level 14 --output-file "$(echo $i | sed 's/.png/.svg/')"; done
Code:
for i in *; do rsvg-convert $i -o `echo $i | sed -e 's/svg$/png/'`; done
Code:
ffmpeg -i image%d.png -vcodec huffyuv test.avi
and it gives a really nice cartoonie look to the video, when I know more about what I am doing, I shall put togheter a script of it, so that it deletes all svgs and pngs in the end.

Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Processing ankan Linux - Software 3 10-11-2013 10:52 AM
batch processing with awk sag47 Linux - General 2 12-04-2010 07:57 AM
[SOLVED] Batch processing images. JamesGT Slackware 12 09-13-2010 07:16 PM
script help for batch processing mma8x Linux - General 5 12-08-2006 01:31 AM
Image batch processing cvzyl Linux - Software 3 03-20-2006 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration