linux下ImageMagick的安装方法

发布时间:2020-07-12编辑:脚本学堂
本文介绍下,在linux中安装ImageMagick的方法,有需要的朋友,可以参考下。

首先,从网上下载 ImageMagick,地址为:www.imagemagick.org

选择适合自己的版本:
http://image_magick.veidrodis.com/image_magick/

本文用的版本为:
http://image_magick.veidrodis.com/image_magick/ImageMagick-6.4.1-10.tar.bz2

如果从官方不好下载的,可以从 sourceforge的下载: http://imagemagick.sourceforge.net

解压缩后,进行编译安装
./configure –prefix=/usr/local/imagemagick –enable-lzw –with-modules && make && make install

默认的就支持jpeg,png等图片。你也可以加入–without-xxx来禁止一些选项,具体的就 ./configure –help | grep without吧。

编译安装的过程,有点长,大家耐心等待安装完成。

/usr/local/imagemagick/bin/convert -quality 90 -resize 100×100 /tmp/origine_image.jpg /tmp/small_100_100.jpg

就是说将/tmp目录下的origine_image.jpg图片重新缩放成100×100的大小保存在/tmp目录下文件名为small_100_100.jpg,图片质量为90。

另外,还可以用php把imagemagick编辑成为php的模块。

就介绍这些吧,imagemagick插好用的,有时间的话,大家好好研究下吧。