Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder with a lot of swf files. They are named that way: fis1.swf; fis2.swf; fis3.swf; ... fis20.swf. I want to convert all of them into png files. I know it can be done with swfrender from swftools, but it only renders one file per time.

share|improve this question
up vote 7 down vote accepted

I'd probably use find to do this:

find -iname 'fis*.swf' -exec swfrender "{}" -o "{}.png" \;

But you could probably use other sorts of loops:

for f in fis{1..20}.swf; do
    swfrender "$f" -o "$f.png"
share|improve this answer

First make a new file and call it for example swfconvert

gedit swfconvert

Paste the code below into it:

for img in *.swf; 
 swfrender "$img" -o "$img.png"

Save and close. Then run the new batch from terminal:

sh swfconvert

This script should work for all swf files in a given directory. It should be saved in the same directory where your .swf files reside

share|improve this answer
Note: You don't need to touch swfconvert. Gedit will automatically create the file after saving. – Glutanimate Mar 15 '14 at 9:54

Similar to Oli answer, you can also use convert tool from imagemagick set.

for f in fis{1..20}; do
convert $f.swf $f.png

This can be put into single line as

for f in fis{1..20}; do convert $f.swf $f.png; done
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.