Linux uses ImageMagick's convert command to compress pictures, save server space

Source: Internet
Author: User
Tags bmp image imagemagick rotate image

First, Installation:

sudoapt-get installimagemagick

Ii. description

ImageMagick's command convert can accomplish this task, its parameter-resize is used to change the image size, you can specify the pixel values directly, or you can specify a zoom percentage. And if you want to reduce the quality of the picture, you can use the-quality parameter of convert, the mass value is 0-100 between the value, the larger the number, the better the quality, the general designation 70-80, basically do not see the difference between before and after.

The powerful convert command can be used to convert image formats, support JPG, BMP, PCX, GIF, PNG, TIFF, xpm, and xwd types, and here are a few examples:

Third, the use

1, get a picture of the size: identify tinywan_ffmpeg056.jpg

2. Example

  Convert  xxx.jpg  xxx.png converts      jpeg to PNG file convert  xxx.gif   xxx.bmp     gif to BMP image   Convert  xxx.tiff  xxx.pcx   

3, change the size of the image

(1) convert-resize 1024x768 xxx.jpg xxx1.jpg Change the image pixel to 1024x768, note that between 1024 and 768 is a lowercase letter X

(2) Convert-sample 50%x50% xxx.jpg xxx1.jpg Reduce the image to the original 50%*50%

(3) Rotate Image: Convert-rotate sky.jpg sky-final.jpg Rotate the image clockwise 270 degrees

(4) Use the-draw option to add text inside the image: Convert-fill black-pointsize 60-font helvetica-draw ' text 10,80 ' Hello, world! ' ' Hello.jpg helloworld.jpg

Iv. More Documentation

Convert usage in Linux

Convert image processing tool for Linux

Linux uses ImageMagick's convert command to compress pictures, save server space

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.