linux下的ImageMagick安装
生活随笔
收集整理的這篇文章主要介紹了
linux下的ImageMagick安装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?檢查系統有無安裝ImageMagick
官方網址是: www.imagemagick.org
從官方不好下載,提供 sourceforge的下載地址: imagemagick.sourceforge.net
shell> rpm -qa | grep ImageMagick
沒有就開始安裝ImageMagick
shell> rpm -Uvh ImageMagick-6.3.4-10.i386.rpm
或者
shell> yum install ImageMagick
?
ImageMagick使用范例
1. 制作索引圖和動畫
montage -bordercolor red -borderwidth 3 -label "%f" -tile 5x3 *.JPG montage.jpg
mogrify -format gif *.JPG display montage.jpg animate *.JPG
2. 縮放 convert -sample 80x40 input.jpg output.jpg
注意:縮放后圖像保持原來的長寬比例 convert -sample 25%x25% input.jpg output.jpg
?
3. 為當前目錄的所有圖像生成縮略圖
do
convert -sample 25%x25% $img thumb-$img
done
?
4. 獲取文件信息 libtiff
pnginfo filename.png
?
5. 可以使用 ImageMagick 的 identify
identify -format "%wx%h" sample.png
?
6. 旋轉圖像
?
7. 更改文件類型
?
8. 為圖像增加注釋文字
-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 -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. 一次執行多個操作
?
11. 按比例縮成固定大小
更多相關范例請參考下面地址:
http://www.imagemagick.org/Usage/thumbnails/
convert 1182743797.jpg -thumbnail x168?? -resize '252x<' -resize 50% -gravity center -crop 126x84+0+0 +repage -quality 90 thumb_1182743797.jpg 摘錄于http://www.phpbulo.com/blog/a/74
總結
以上是生活随笔為你收集整理的linux下的ImageMagick安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JAVA知识基础(九):this、sup
- 下一篇: linux命令复习之有关磁盘空间的命令