Install ImageMagick in linux

Source: Internet
Author: User
Tags imagemagick

ImageMagick (TM) is a free software for creating, editing, and merging images. It can read, convert, and write images in multiple formats. Image cutting, color replacement, application of various effects, image rotation, combination, text, straight line, polygon, elliptic, curve, attached to image stretching and rotation. ImageMagick is a free software: all source code is open and can be freely used, copied, modified, and released. It complies with the GPL license agreement. It can run on most operating systems. Most functions of ImageMagick come from the command line tool. Generally, it supports the following programming languages: Perl, C, C ++, Python, PHP, Ruby, and Java; ready-made ImageMagick interfaces (PerlMagick, Magick ++, PythonMagick, magickWand for PHP, RubyMagick, and JMagick) is usable. This makes it possible to automatically and dynamically modify and create images. ImageMagick supports at least 90 image formats: A, ART, AVI, AVS, B, BIE, BMP, BMP 2, BMP3, C, CACHE, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CUR, CUT, DCM, DCX, DNG, DOT, DPS, DPX, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, FAX, FITS, FPX, FRACTAL, G, G3, GIF, GIF87, GRADIENT, GRAY, HDF, HISTOGRAM, HTM, HTML, ICB, ICO, ICON, JBG, JBIG, JNG, JP2, JPC, JPEG, JPG, JPX, K, LABEL, M, M2V, MAP, MAT, MATTE, MIFF, MNG, MONO, MPC, MPEG, MPG, MSL, MTV, MVG, NULL, O, OTB, P7, PAL, PALM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PFA, PFB, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, TIF, TIFF, TILE, TIM, TTC, TTF, TXT, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMFWIN32, WMZ, WPG, X, XBM, XC, XCF, XPM, XV, XWD, Y, YCbCr, YCbCrA, YUV

Download from the official website: imagemagick.sourceforge.net

Download the package and decompress it,

./Configure-prefix =/usr/local/imagemagick-enable-lzw-with-modules & make install

Basically, this is enough.

By default, images such as jpeg and png are supported.

You can also add-without-xxx to disable some options. For more information, see./configure-help | grep.

It takes a long time to compile OK.

Then you can test it.
/Usr/local/imagemagick/bin/convert-quality 90-resize 100x100/tmp/origine_image.jpg/tmp/small_100_100.jpg

In other words, the origine_image.jpg image in the/tmpdirectory is scaled to a size of 100 × 100 and saved in the/tmpdirectory. The file name is small_100_100.jpg, and the image quality is 90.

For more details, you will know when using it. You can also use php to edit imagemagick into a php module.

Set environment variables according to your own situation:

Modify/etc/profile

LD_LIBRARY_PATH =/usr/local/lib:/usr/local/imagemagick

Export LD_LIBRARY_PATH

Add/etc/ld. so. conf

Related Article

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.