Just add the extensions you want to handle; eg:
for f in *.png *.tif *.gif; do
or simply:
for f in *.{png,tif,gif}; do
another approach may be as follows: find each image file in a directory or folder tree and convert them to jpg, except that the image is already a jpg file; for example (not verified):
find . -exec bash -c 'file "$1" | grep "image data" | grep -iv JPEG && convert "$1" -resize 50% "${1%.*}.jpg"' {} {} \;
source share