How To Convert Png To Jpeg And Vice-Versa


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

Install Imagemagick

Imagemagick is very usefull 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 fomat.

Convert Multiple Files From Png To Jpg

We will convert multiple files to the jpg

Convert Multiple Files From Jpg To Png

We can do vice-versa like below

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.

LEARN MORE  Linux dd Command To Backup with Examples

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)