||
convert [options ...] file [ [options ...] file ...] [options ...] file |
#格式转换
$ convert pencil.jpg pencil.gif
|
#将图片长宽改为原来的一半
$ convert pencil.jpg -resize 50% pencil.gif
|
#将图片改为800x600大小(为了保证原图像长宽比,转换得到的图不一定是800x600)
$ convert pencil.jpg -resize 800x600 pencil.gif
#强制输出为800x600大小,不保证长宽比
$ convert pencil.jpg -resize 800x600! pencil.gif
|
#将图片顺时针旋转90度
$ convert pencil.jpg -rotate 90
pencil.gif
|
#将PS文件转换为png图片,并设置DPI为300,裁剪空白
$ convert -density 300 -trim foo.ps foo.png
|
#将图片RGB通道分别提出存为新图片(在老版本中可能不能正常运行)
$ convert -separate -channel
RGB pencil.jpg RGB-%d.jpg
#或者每次提取一个通道
$ convert -separate -channel R pencil.jpg R.jpg
$ convert -separate -channel G pencil.jpg G.jpg
$ convert -separate -channel B pencil.jpg B.jpg#将3个图片分别作为RGB通道值合并为新的图片 $ convert R.jpg G.jpg B.jpg -channel RGB -combine
pic.png
|
#批量处理,将所有ps格式的图片转换为png格式(使用前最好对原ps文件做备份)
$ mogrify -density 200 -trim -format png *.ps
|
Copyright ©2011-2014 bbs.06climate.com All Rights Reserved. Powered by Discuz! (京ICP-10201084)
本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论