I use this script to convert all the .png files in a directory to .jpg files. If I want to convert not just png files, but also tif, gif and bmp files into jpg, how this script can be modified?
#!/bin/bash
for f in *.png ; do
convert "$f" -resize 50% "${f%.*}.jpg"
done
Just add the exensions you want to process; for example:
or just:
another approach could be: find every image file in a directory or a tree of folders and convert them to jpg except if the image is already a jpg file; for example (not tested):