Chinaunix首页 | 论坛 | 博客
  • 博客访问: 635360
  • 博文数量: 205
  • 博客积分: 7891
  • 博客等级: 少将
  • 技术积分: 2168
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-29 13:16
文章分类

全部博文(205)

文章存档

2015年(4)

2014年(5)

2013年(1)

2012年(4)

2011年(51)

2010年(86)

2009年(45)

2008年(9)

分类: LINUX

2010-11-12 11:35:12


安装:
复制内容到剪贴板
代码:
sudo apt-get install imagemagick
1. 制作索引图和动画

!/bin/bash
montage -bordercolor red -borderwidth 3 -label “%f” -tile 5×3 *.JPG montage.jpg
mogrify -format gif *.JPG
display montage.jpg
animate *.JPG

2. 缩放 convert -sample 80×40 input.jpg output.jpg #注意:缩放后图像保持原来的长宽比例 convert -sample 25%x25% input.jpg output.jpg
3. 为当前目录的所有图像生成缩略图

for img in `ls *.jpg`
do
convert -sample 25%x25% $img thumb-$img
done

4. 获取文件信息 libtiff

tiffinfo filename.tiff
pnginfo filename.png

5. 可以使用 ImageMagick 的 identify

identify -verbose sample.png
identify -format “%wx%h” sample.png

6. 旋转图像

convert -rotate 90 input.jpg output.jpg

7. 更改文件类型

convert input.jpg output.png

8. 为图像增加注释文字

convert -font helvetica -fill white -pointsize 36 \
-draw ‘text 10,50 “Floriade 2002, Canberra, Australia”‘ \
floriade.jpg comment.jpg
convert -font fonts/1900805.ttf -fill white -pointsize 36 \
-draw ‘text 10,475 “stillhq.com”‘ \
floriade.jpg stillhq.jpg

9. 特殊效果

convert -charcoal 2 input.jpg output.jpg #炭笔
convert -colorize 255 input.jpg output.jpg #着色 可以指定三种颜色 red/green/blue
convert -implode 4 input.jpg output.jpg #内爆效果
convert -solarize 42 input.jpg output.jpg #曝光,模拟胶片曝光
convert -spread 5 input.jpg output.jpg #随机移动,参数是位移大小

10. 一次执行多个操作

convert -sample 25%x25% -spread 4 -charcoal 4 input.jpg output.jpg
阅读(2443) | 评论(1) | 转发(1) |
0

上一篇:杂记(1)-2010-11-12

下一篇:双网卡

给主人留下些什么吧!~~

chinaunix网友2010-11-12 17:19:10

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com