How to convert XCF to PNG using GIMP from the command-line?

后端 未结 5 1947
误落风尘
误落风尘 2021-02-01 03:02

As part of my build process I need to convert a number of XCF (GIMP\'s native format) images into PNG format. I\'m sure this should be possible using GIMP\'s batch mode, but I h

5条回答
  •  忘掉有多难
    2021-02-01 03:27

    Before jsbueno posted his answer I had also tried asking on the #gimp IRC channel. I was directed to this thread on Gimptalk which contains the following code:

    gimp -n -i -b - <

    This scriptfu globs for xcf files, and then for each file it loads the file, merges the visible layers, saves the result as a PNG, and "unloads" the image. Finally, it quits GIMP. The glob approach is used to avoid starting up GIMP for each image. It also side-steps the issue of getting parameters from the shell into gimp.

    I'm posting this answer just in case someone needs a way to do this without the use of GIMP-Python (perhaps because it isn't installed).

提交回复
热议问题