现在的位置: 首页 > 综合 > 正文

ppm格式图片 批量转 bmp格式图片 的 shell 脚本

2013年08月29日 ⁄ 综合 ⁄ 共 229字 ⁄ 字号 评论关闭

运行环境ubuntu 12.04 LTS

首先要下载ppmtobmp软件: sudo apt-get install netpbm

#! /bin/sh

cd $1
cnt=0
flist=`ls`
for file in $flist
do
ppmtobmp $file > $cnt.bmp 
echo "$file ---> $cnt.bmp"
cnt=`expr $cnt + 1`

done

 //可以将您输入的路径内的所有ppm图片转换成bmp图片,bmp图片的名字是从0开始作为文件名的。

//参数1: 路径名。

抱歉!评论已关闭.