如何将.xcf文件批量转换为.png文件?

How to convert .xcf files to .png files in batch?

我正在使用 Windows。我有一个包含 .xcf 个文件的文件夹,每个文件 100x100px。我想要 运行 一个将它们转换为 .png 文件的过程,使它们成为 40x40px。我该怎么做?

您可能会成功使用 ImageMagick which also supports XCF for reading. They also provide Windows binaries. The tool also has various transformation (scaling) options,因此您可以一次调用转换和缩放每个图像:

convert source.xcf -resize 40x40 target.png

我不熟悉 Windows 批处理编程,现在无法访问 Windows PC,我认为一个简单的循环看起来像这样:

for %%f in (*.xcf) do (
    convert %%f -resize 40x40 %%~nf.png
)