Linux uses the convert command under ImageMagick to convert the image format

1.Convert instructions

The convert command can be used to convert image formats, supporting image formats such as bmp, jpg, png, gif, tiff, etc. In some Linux systems, the convert tool has been installed. You can use convert 1.bmp 2.jpg and similar commands to convert 1. Convert bmp picture files to jpg, png, gif and other formats. If you cannot use the convert command to convert the image format after verification, you need to install convert using the ImageMagick package.

2. ImageMagick installation

Download ImageMagick.tar.gz, download path: https://www.imagemagick.org/download/ImageMagick.tar.gz
Unzip ImageMagick.tar.gz, and enter the ImageMagick-7.0.10-58 folder.
tar -zxvf ImageMagick.tar.gz
cd ImageMagick-7.0.10-58
Configuration file, remove unused modules and generate Makefile
./configure --prefix=/usr/local/ImageMagick --enable-shared=no --enable-static=yes --with-djvu=no --with-fontconfig=no --with-freetype=no --with-magick-plus-plus=no --with-openexr=no --with-pango=no --with-wmf=no --with-x=no
make
make
Install the ImageMagick tool in the current system
sudo make install
After performing the above steps, an ImageMagick folder will be generated under the /usr/local folder. The specific contents of the folder are as follows: After the
Insert picture description here
installation is complete, you can use the command " convert source file target file " in the system to convert the image to the format. be / usr / local / ImageMagick / bin after convert files in the copy out, you can use to run an executable file's image format conversion, in particular " ./convert source file destination ."

Guess you like

Origin blog.csdn.net/sxtdzj/article/details/112988910