Linux under Convert installation configuration and use tutorial

Source: Internet
Author: User
Tags install php imagemagick


Install ImageMagick

# yum Install ImageMagick imagemagick-devel

# convert-version Version:imagemagick-6.2.8 05/07/12

file: /usr/share/imagemagick-6.2.8/doc/index.html

copyright:copyright (C) 1999-2006 ImageMagick Studio LLC

You can also install PHP extensions Imagick


http://php.net/manual/en/book.imagick.php

Convert command

Convert picture format


# convert Src.jpg dst.png

Specify the image quality after processing


# convert-quality Src.jpg dst.png

Scaling


-resize widthxheight{%} {@} {!} {<}>} {^}

1, according to the wide high school big side enlarges or shrinks, the other side is treated proportionally.

# convert-resize 600x600 src.jpg dst.jpg

The 600x600 here represents 600px and can be expressed as a percentage, and the following command indicates that it will shrink to 50%, to 80%.


# convert-resize 50%x80% src.jpg dst.jpg

2, adjust the picture to a fixed size, you can add an exclamation point after the wide height!


# convert-resize 600x600! Src.jpg dst.jpg

3, fixed width or height zoom, the other side of the proportional treatment

# convert-resize Src.jpg dst.jpg
# convert-resize X400 src.jpg dst.jpg

4, use @ To specify the number of pixels in the picture.


# convert-resize "10000@" Src.jpg dst.jpg

Original size 910x1365, 81x122 after execution

5, the picture is greater than or less than a certain size zoom


# convert-resize "300x200>" Src.jpg dst.jpg

300x200> means to shrink when the picture is larger than 300x200
300x200< means to zoom in when the picture is less than 300x200

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.