How to bulk convert .jpg to .png (and vice versa) in Solus Linux?

Written by Administrator on Sunday April 26, 2020

Conversion between different image formats in Solus is very simple and fast, when you have ImageMagick tools installed. One of these tools is mogrify. It has a vast set of functionality, but now we need only image conversion.

To convert image in one format to another you need to use flag -format and then provide the name of the orginial file and the name of the converted one:

$ magick mogrify -format image1.jpg image1.png

But this example of convertng only one file. In case we need to convert all images in folder of certain format, (bulk conversion) we can use a mask:

Let's take a real example of how it works. I have a folder with several .jpg images in it:

$ ls

And now if you want to convert all .jpg files in our /images folder to .png format, you can simply execute a command:

$ magick mogrify -format png *.jpg

And the result:

$ ls