Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting XCF and other files using command line with GIMP?

If I have an XCF file (or any other supported by Gimp) how can I convert it to, for example, PNG for display or further processing?

like image 998
Ivan Vučica Avatar asked Mar 10 '09 14:03

Ivan Vučica


People also ask

How do I convert XCF files?

How to Convert an XCF File. GIMP saves files to this format by default, but you can use the File > Export menu to save it as something else, like a JPG or PNG. You can also use a free image file converter like Zamzar to convert the file to PDF, GIF, AI, TGA, WEBP, TIFF, and other similar file formats.

How do I run GIMP from command line?

Running GIMP. Usually you start GIMP either by clicking an icon (if your system is set up to provide you with one), or by typing gimp on a command line. If you have multiple versions of GIMP installed, you may need to type gimp-2.10 to get the newest version.


2 Answers

I'm a couple of years late, but I thought I'd add what I think is by far the best solution: there is a tool suite called Xcftools (on Ubuntu, apt-get install xcftools), which has a utility called xcf2png that does this job perfectly.

xcf2png image.xcf -o image.png

This is much better than a) using ImageMagick (which as I said in a comment above is horribly broken), or b) using Gimp (which has an extremely complicated scripting language for simply exporting an image).

like image 103
mgiuca Avatar answered Oct 21 '22 22:10

mgiuca


I guess ImageMagick should do what you want (and even more)

convert image.xcf image.png
like image 34
jassuncao Avatar answered Oct 21 '22 21:10

jassuncao