I have a folder with a lot of xcf files which I want all to be converted to png files, at best via a one-liner from bash.

How can I achieve such a task?

  • 2
    With xcf2png... – jasonwryan Apr 14 '13 at 23:54
  • @jasonwryan Thanks, worked like a charm. – k0pernikus Apr 15 '13 at 0:01
  • 1
    You may want to give a try to convert tool from ImageMagick. Supports a lot of formats and operations, might be useful in future. – TNW Apr 15 '13 at 0:48

One-liner from bash:

for i in *.xcf; do xcf2png -f $i -o $i.png; done


You can use GIMP Image editor and use Export to tool. Use Ctrl-Shift-E as shortcut.
Or you could use convert from imagemagick:

convert filename.xcf filename.png

You could also use xcftools (sudo apt-get install xcftools), which has a utility called xcf2png that does this job perfectly.

xcf2png image.xcf -o image.png

same of @k0pernikus, but remove xcf extension from output filename

for i in *.xcf; do xcf2png -f $i -o "${i%.*}.png"; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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