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