简体   繁体   English

所以我有一个包含大约 300 个 png 文件的文件夹,我想将它们全部转换为 jpg 文件

[英]So I have a folder which contains around 300 png files and I want to convert all of them to jpg files

i have a access to a Ubuntu server and a macOS installation我可以访问 Ubuntu 服务器和 macOS 安装

I've searched only but haven't found anything我只搜索过但没有找到任何东西

install imagemagick and rename安装 imagemagick 并重命名

sudo apt install imagemagick rename

go in the folder to be safe go 在文件夹里要安全

cd /dir/with/pngs

convert them all in a for/do/done loop在 for/do/done 循环中将它们全部转换
for png in $(ls -1 *.png); do
   convert "$png" "${png/png/jpg}"
done

You win one million fire emojiis.你赢了一百万个火表情符号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 jpg 文件转换为 pdf - Convert jpg files to a pdf In Python I'm trying to convert all files in directory from PDF to CSV, then edit csv with Pandas before saving to new folder - In Python I'm trying to convert all files in directory from PDF to CSV, then edit csv with Pandas before saving to new folder 作为文件夹中的音乐文件,将它们从 .ogg 转换为 .mp3 (pytnon) - As music files in a folder, convert them from .ogg to .mp3 (pytnon) 将文件夹中的所有Solidworks文件转换为步骤文件宏 - Convert all Solidworks files in folder to step files macro Pandas 和 glob:将文件夹中的所有 xlsx 文件转换为 csv – TypeError:__init__() 得到了一个意外的关键字参数“xfid” - Pandas and glob: convert all xlsx files in folder to csv – TypeError: __init__() got an unexpected keyword argument 'xfid' 如何转换 scss 文件以用作 css - How can I convert scss files for use as css ImageMagick:如何将 pdf 转换为 jpg? 我收到错误:此图像格式没有解码委托 - ImageMagick: How do I convert pdf to jpg? I get ERROR: no decode delegate for this image format YUV 422 转 PNG/JPG/ - YUV 422 to PNG/JPG/ 通过VBA将目录中的所有XML文件转换为XLS - Convert all XML files in a directory to XLS via VBA 如何通过命令行将 Kali Linux 上的 rtf 转换为 txt 文件? - How can I convert rtf to txt files on Kali Linux by command-line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM