How to convert images to any formats in Linux (SOLVED)

Universal image converter for Linux

Linux has ImageMagick, which supports hundreds of image formats and can convert an image from any format to any other.

The “convert” and “magick” utilities from the ImageMagick package do an excellent job of converting images (JPG and other formats).

For details on installing ImageMagick, including which dependencies need to be installed to support the maximum number of formats, see the article: ImageMagick guide: installing, using, and troubleshooting.

You can view the full list of supported formats with the command

magick -list format

Also at the end of the article is a table with a complete list of supported file formats and their brief description.

How to convert images on the Linux command line

To convert one image to any other, run the following command:


Note: if you get an error that the “magick” command was not found, then use the “convert” command instead. An explanation will be given below.

The program will automatically detect the original image format.

As for the output file format, it is determined by the extension specified in the previous command.

For example:

magick IMAGE.jpg RESULT.png

The following command will convert the image.png file to JPG format and save the new image to the image.jpg file:

magick image.png image.jpg

You can also convert dynamic images (such as GIF files) to video clips (avi, 3gp, webm, wmv, flv, mkv, mpg, webm, m2v, m4v, mov, mp4, mpeg and others).

You can also convert video formats avi, 3gp, webm, wmv, flv, mkv, mpg, webm, m2v, m4v, mov, mp4, mpeg and others to GIF files.

How to compress an image when converting

For information on how to convert and reduce the size of an image at the same time, see the article: How to reduce image size. Bulk photo scaling and resizing on the command line

Convert images to all formats online

If you do not want to install the ImageMagick package, then you can use online image conversion to any format. This is a free online service, you just need to specify the image to be converted and select the desired format of the new file.


Continue reading: How to convert a large number of images to another format

Leave Your Observation

Your email address will not be published.