How to install and use ImageMagick software in Linux system?

Time:2020-2-11

ImageMagick is a set of command-line utilities for modifying and processing images. ImageMagick can quickly perform operations from the terminal, perform batch processing of many images, or be integrated into a bash script. ImageMagick can perform various operations. This guide introduces you to the syntax and basic operations of ImageMagick, and shows you how to combine operations and perform many image batches.

Software name:
ImageMagick image processing software v7.0.8-67 Q16 free installation 32-bit
Software size:
32.8MB
Updated:
2019-10-04

1, installation

ImageMagick, which is not included in Ubuntu and many other Linux distributions. To install it on Ubuntu, use the following command:sudo apt-get install imagemagick

2. Between format conversions

Transform the image format. The most basic thing you can do is transform between formats. The following command converts the PNG file named “howtogeek. PNG” in the current directory to a JPEG format: convert howtogeek.png howtogeek.jpg

You can also specify JPEG image compression level:convert howtogeek.png -quality 95 howtogeek.jpg  Number must be 1 and 100 default is 92

3. Resize image

The convert command can also quickly resize images. UnderThe command of face requires ImageMagick to adjust the image size to 200 pixels wide and 100 pixels highconvert example.png -resize 200×100 example.png

4. Rotating image

ImageMagick can rotate the image quickly.The following command names the image howtogeek.jpg and rotates it 90 degrees, and save the rotated image howtogeek rotated.jpg:

convert howtogeek.jpg -rotate 90 howtogeek-rotated.jpg

5. Application effect

ImageMagick can be applied to various effects of the image. For example, the following command applies an image of the charcoal effect:convert 1234.jpg -charcoal 2 1234-charcoal.jpg

6. Batch processing

The following command rotates all Pang pictures:for file in *.png;do convert $file -rotate 90 rotated-$file;

Relevant recommendations:

What to do with files in Linux that cannot be deleted with root permission?

Two solutions to how to run. Sh file with the command under Linux

How to change the screen resolution in Linux