使用ImageMagick创建,编辑,合成或转换位图pix。它实际上可以用一种编解码器(超过200种)来读取和写入快照,包括PNG,JPEG,JPEG-2000,GIF,TIFF,DPX,EXR,WebP,Postscript,PDF和SVG。使用ImageMagick调整大小,翻转,镜像,旋转,变形,剪切并显影为快照,更改图像颜色,遵循各种特定效果,或绘制文本,线条,多边形,椭圆和Bézier曲线。本文介绍了“-如何安装” Ubuntu上的ImageMagick”
在安装ImageMagick之前,应按如下所示构建必需的要素–
$sudo apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
样本输出应如下所示–
Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version (12.1ubuntu2). The following NEW packages will be installed: checkinstall 0 upgraded, 1 newly installed, 0 to remove and 204 not upgraded. Need to get 121 kB of archives. After this operation, 516 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 checkinstall amd64 1.6.2-4ubuntu1 [121 kB] Fetched 121 kB in 0s (162 kB/s) ..................................................................................
现在下载ImageMagick,如下所示–
$sudo wget http://www.imagemagick.org/download/ImageMagick.tar.gz
样本输出应如下所示–
--2017-01-27 11:49:08-- http://www.imagemagick.org/download/ImageMagick.tar.gz Resolving www.imagemagick.org (www.imagemagick.org)... 198.72.81.86 Connecting to www.imagemagick.org (www.imagemagick.org)|198.72.81.86|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 12746042 (12M) [application/x-gzip] Saving to: ‘ImageMagick.tar.gz’ ImageMagick.tar.gz 100%[===================>] 12.16M 1.28MB/s in 14s 2017-01-27 11:49:22 (907 KB/s) - ‘ImageMagick.tar.gz’ saved [12746042/12746042]
如下所示解压缩下载的文件–
$sudo tar xzvf ImageMagick.tar.gz
样本输出应如下所示–
ImageMagick-7.0.4-5/PerlMagick/t/ttf/ ImageMagick-7.0.4-5/PerlMagick/t/ttf/read.t ImageMagick-7.0.4-5/PerlMagick/t/ttf/input.ttf ImageMagick-7.0.4-5/PerlMagick/t/composite.t ImageMagick-7.0.4-5/PerlMagick/t/input.dib ImageMagick-7.0.4-5/PerlMagick/t/input_p5.pgm ImageMagick-7.0.4-5/PerlMagick/t/input_70x46.uyvy ImageMagick-7.0.4-5/PerlMagick/t/input.im8 ImageMagick-7.0.4-5/PerlMagick/t/input.sgi ImageMagick-7.0.4-5/PerlMagick/t/png/ ImageMagick-7.0.4-5/PerlMagick/t/png/input.mng ImageMagick-7.0.4-5/PerlMagick/t/png/write.t ImageMagick-7.0.4-5/PerlMagick/t/png/read-16.t ImageMagick-7.0.4-5/PerlMagick/t/png/input_256.png ImageMagick-7.0.4-5/PerlMagick/t/png/input_bw.png ImageMagick-7.0.4-5/PerlMagick/t/png/input_truecolor.png ImageMagick-7.0.4-5/PerlMagick/t/png/write-16.t ImageMagick-7.0.4-5/PerlMagick/t/png/input_mono.png ..........................................................................
要验证上述命令,请使用以下命令–
$ ls
样本输出应如下所示–
ImageMagick-7.0.4-5 ImageMagick.tar.gz
现在进入提取的目录,如下所示–
$cd ImageMagick-7.0.4-5
要检查配置,请使用以下命令–
~/ImageMagick-7.0.4-5# ./configure
要构建源代码,请使用以下命令,如下所示–
~/ImageMagick-7.0.4-5# make clean ~/ImageMagick-7.0.4-5# make ~/ImageMagick-7.0.4-5# checkinstall ~/ImageMagick-7.0.4-5# ldconfig /usr/local/lib
要获取有关magick的更多信息,请使用以下命令–
$ magick -help
样本输出应如下所示–
Usage: magick [ {option} | {image} ... ] {output_image} magick [ {option} | {image} ... ] -script {filename} [ {script_args} ...] magick -help | -version | -usage | -list {option}
要获取magick的版本,请使用以下命令-
$ magick -version
样本输出应如下所示–
Version: ImageMagick 7.0.4-5 Q16 x86_64 2017-01-27 http://www.imagemagick.org Copyright: © 1999-2017 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Features: Cipher DPC HDRI OpenMP Delegates (built-in): x zlib
在本文中,我们了解了–如何在Ubuntu上安装ImageMagick,我们将提供更多基于Linux的技巧和窍门。继续阅读!。