云网牛站
所在位置:首页 > Linux软件 > 在Linux系统下ImageMagick的安装及使用方法

在Linux系统下ImageMagick的安装及使用方法

2018-10-03 11:38:10作者:ywnz稿源:云网牛站

ImageMagick是一款非常好用的屏幕截图工具,在Ubuntu、Mint等主流Linux发行版本中会自带ImageMagick工具。新版本是ImageMagick 7.0.8-12,已经提供下载,能运行在Linux、Windows、Mac Os X、iOS、Android OS系统中,它支持多种格式,如PNG、JPEG、GIF、HEIC、TIFF、DPX、EXR、WebP、Postscript、PDF、SVG等。使用ImageMagick调整大小、翻转、镜像、旋转、扭曲、剪切和变换图像,调整图像颜色,应用各种特殊效果,或绘制文本、线、多边形、椭圆和贝塞尔曲线。如果你的Linux系统没有这款工具,你可以按照下面的方法进行安装。

在Linux系统下ImageMagick的安装及使用方法

 

相关地址

github下载地址

ImageMagick网站

 

安装ImageMagick

1.如果是Ubuntu、Mint等系统可以在终端中运行以下命令安装:

sudo apt-get install imagemagick

2.安装的文档(英文)

ImageMagick RPM's are self-installing. Simply type the following command and you're ready to start using ImageMagick:

$ rpm -Uvh ImageMagick-7.0.8-12.x86_64.rpm

You'll need the libraries as well:

$ rpm -Uvh ImageMagick-libs-7.0.8-12.x86_64.rpm

For other systems, create (or choose) a directory to install the package into and change to that directory, for example:

cd $HOME

Next, extract the contents of the package. For example:

tar xvzf ImageMagick.tar.gz

Set the MAGICK_HOME environment variable to the path where you extracted the ImageMagick files. For example:

$ export MAGICK_HOME="$HOME/ImageMagick-7.0.8"

If the bin subdirectory of the extracted package is not already in your executable search path, add it to your PATH environment variable. For example:

export PATH="$MAGICK_HOME/bin:$PATH

On Linux and Solaris machines add $MAGICK_HOME/lib to the LD_LIBRARY_PATH environment variable:

LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MAGICK_HOME/lib

export LD_LIBRARY_PATH

Finally, to verify ImageMagick is working properly, type the following on the command line:

magick logo: logo.gif

identify logo.gif

display logo.gif

3.提供有AppImage

可以参考下载运行AppImage:简单、可靠、快速的特性一文。

 

使用ImageMagick

1.安装ImageMagick完成后,执行以下命令就能在Linux系统中获取到屏幕截图(截取整个屏幕):

import -window root image.png

这里的“image.png”就是屏幕截图文件保存的名称,可以自由定义。

2.如果要获取屏幕的某一个区域截图,可以执行以下命令:

import image.png

“image.png”可以自定义为其他的名称。

 

附:ImageMagick特点与功能

Here are just a few examples of what ImageMagick can do:

Format conversion: convert an image from one format to another (e.g. PNG to JPEG).

Transform: resize, rotate, deskew, crop, flip or trim an image.

Transparency: render portions of an image invisible.

Draw: add shapes or text to an image.

Decorate: add a border or frame to an image.

Special effects: blur, sharpen, threshold, or tint an image.

Text & comments: insert descriptive or artistic text in an image.

Image gradients: create a gradual blend of one color whose shape is horizontal, vertical, circular, or ellipical.

Image identification: describe the format and attributes of an image.

Composite: overlap one image over another.

Montage: juxtapose image thumbnails on an image canvas.

Generalized pixel distortion: correct for, or induce image distortions including perspective.

Morphology of shapes: extract features, describe shapes and recognize patterns in images.

Delineate image features: Canny edge detection, mean-shift, Hough lines.

Motion picture support: read and write the common image formats used in digital film work.

Image calculator: apply a mathematical expression to an image or image channels.

Connected component labeling: uniquely label connected regions in an image.

Discrete Fourier transform: implements the forward and inverse DFT.

Perceptual hash: maps visually identical images to the same or similar hash-- useful in image retrieval, authentication, indexing, or copy detection as well as digital watermarking.

Complex text layout bidirectional text support and shaping.

Color management: accurate color management with color profiles or in lieu of-- built-in gamma compression or expansion as demanded by the colorspace.

High dynamic-range images: accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows.

Encipher or decipher an image: convert ordinary images into unintelligible gibberish and back again.

Virtual pixel support: convenient access to pixels outside the image region.

Large image support: read, process, or write mega-, giga-, or tera-pixel image sizes.

Threads of execution support: ImageMagick is thread safe and most internal algorithms are OpenMP-enabled to take advantage of speed-ups offered by multicore processor chips.

Distributed pixel cache: offload intermediate pixel storage to one or more remote servers.

Heterogeneous distributed processing: certain algorithms are OpenCL-enabled to take advantage of speed-ups offered by executing in concert across heterogeneous platforms consisting of CPUs, GPUs, and other processors.

ImageMagick on the iPhone: convert, edit, or compose images on your iPhone.

 

相关主题

Arch Linux服务器启用Imagemagick PHP扩展

精选文章
热门文章