LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   autotrace batch processing (https://www.linuxquestions.org/questions/linux-software-2/autotrace-batch-processing-937237/)

laulau 03-30-2012 04:31 AM

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

Snark1994 04-01-2012 07:40 AM

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,

laulau 04-01-2012 03:43 PM

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!


All times are GMT -5. The time now is 08:17 PM.