First, Installation:
sudo
apt-get
install
imagemagick
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