Linux system ImageMagick image processing

Source: Internet
Author: User
Tags imagemagick

ImageMagick is a free open source software that creates, edits, and synthesizes images in a Linux system. It can read, convert , write , cut, color Replace, application of various effects, picture rotation, composition, text, line, polygon, ellipse, curve, attach to the picture stretching rotation in many formats.


1. The system must install the Jpg,png,zlib library file

[email protected] ~]# Yum install libpng libpng-devel libjpeg libjpeg-devel zlib zlib-deve perl prel-devel freetype Free Type-devel Ghostscript Ghostscript-devel-y


2. Download and install ImageMagick

[Email protected] ~]# wget http://downloads.jmagick.org/6.4.0/ImageMagick-6.4.0-0.tar.gz

[Email protected] ~]# tar xvf imagemagick-6.4.0-0.tar.gz

[Email protected] ~]# CD ImageMagick-6.4.0

[Email protected] imagemagick-6.4.0]#/configure--prefix=/usr/local/imagemagick-6.4.0--enable-shared

ZLIB--with-zlib=yes Yes-these three extensions must be yes, otherwise the conversion graph processing will be error-

JPEG v1--with-jpeg=yes Yes

PNG--with-png=yes Yes

Ghostscript None GS (8.70)--must be enabled, otherwise the merge graph will error

[[email protected] imagemagick-6.4.0]# make && make install

[Email protected] imagemagick-6.4.0]# Cd/usr/local/imagemagick-6.4.0/bin

[Email protected] bin]# vim/etc/ld.so.conf.d/imagemagick.conf

Include/usr/local/imagemagick-6.4.0/lib--Add a row

[email protected] bin]# LL

Total 328

-rwxr-xr-x 1 root root 25599 11:12 Animate--Animated image sequence

-rwxr-xr-x 1 root root 26719 Nov 11:12 Compare

-rwxr-xr-x 1 root root 25611 Nov 11:12 composite

-rwxr-xr-x 1 root root 25599 Nov 11:12 conjure

-rwxr-xr-x 1 root root 27904 11:12 Convert-image conversion, cropping

-rwxr-xr-x 1 root root 25599 11:12 display-show image

-rwxr-xr-x 1 root root 26721 11:12 Identify-shows the format and characteristics of one or more images

-rwxr-xr-x 1 root root 25597 Nov 11:12 Import

-rwxr-xr-x 1 root root 1365 Nov 11:12 magick-config

-rwxr-xr-x 1 root root 1408 Nov 11:12 magick++-config

-rwxr-xr-x 1 root root 1373 Nov 11:12 magickcore-config

-rwxr-xr-x 1 root root 1378 Nov 11:12 magickwand-config

-rwxr-xr-x 1 root root 25599 11:12 mogrify--Modify image

-rwxr-xr-x 1 root root 25599 11:12 montage-Create a separate picture

-rwxr-xr-x 1 root root 25597 11:12 stream

-rwxr-xr-x 1 root root 1360 Nov 11:12 Wand-config

[Email protected] bin]#


3. Illustrative examples

(1) View picture information

[Email protected] bin]#/identify 2.png--View picture information

2.png png 200x150 200x150+0+0 directclass 16-bit 21.3379kb


(2) Change the image size

[Email protected] bin]#/mogrify-resize 50x50 2.png

[Email protected] bin]#./identify 2.png

2.png png 50x38 50x38+0+0 directclass 16-bit 10.6973kb

[Email protected] bin]#


(3) Three images merged into one picture

[Email protected] bin]#/montage-mode concatenate-tile 3x1 2.jpg 2.png 3.ico 4.jpg


(4) Image format conversion

[Email protected] bin]#./identify 4.jpg

4.jpg JPEG 750x375 750x375+0+0 directclass 8-bit 51.375kb

[Email protected] bin]#/convert 4.jpg 4.png

[Email protected] bin]#./identify 4.png

4.png png 750x375 750x375+0+0 directclass 8-bit 365.721kb

[Email protected] bin]#


(5) Add text to the image

[[email protected] bin]#./convert-draw ' text 0,0 "111111" ' 2.png 5.png--text is a location


This article is from the "Days Together" blog, please be sure to keep this source http://tongcheng.blog.51cto.com/6214144/1717372

Linux system ImageMagick image processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.