安装JPG和PNG压缩
1 2 | yum install jpegoptim yum install optipng |
然后在需要压缩的目录下执行如下命令进行压缩jpg格式的图片
1 2 3 4 5 | //压缩JPG find . -name '*.jpg' | xargs jpegoptim --strip-all
//压缩PNG find -type f -name "*.png" -exec optipng {} \; |
安装JPG和PNG压缩
1 2 | yum install jpegoptim yum install optipng |
然后在需要压缩的目录下执行如下命令进行压缩jpg格式的图片
1 2 3 4 5 | //压缩JPG find . -name '*.jpg' | xargs jpegoptim --strip-all
//压缩PNG find -type f -name "*.png" -exec optipng {} \; |
最近需要批量压缩一批图片、这个时候首先想到的肯定是python能不能帮助我完成这个问题、搜索了一下网上的教程发现还真有,总结分享一下给大家、有不明白的地方可以留言沟通。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M