How To Convert Png To Jpeg And Vice-Versa? – POFTUT

How To Convert Png To Jpeg And Vice-Versa?

I have a lot of pictures with different formats. But daily used formats are png and jpeg. I want to convert them vice-versa. How can I achieve that?

Install Imagemagick

Imagemagick is very useful library and tool to work with image files. It is used a lot of popular projects for media related operations.

Convert Png To Jpg

We will simply convert png extensions to the jpeg format.

Convert Multiple Files From Png To Jpg

We will convert multiple files to the jpg

Convert Multiple Files From Jpg To Png

We can also convert the Jpg files into Png files with the following command. As done previously the name will be kept the same and just the format and the extension will be change.

Convert Using Bash Loop Through Shell

We can use bash loops to loop over image files and run convert command.

Convert Using Bash Loop Through With Bash Script

Some times using bash script is better then running shell. We use following script with file name

To make script executable run following command.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)