This example looks for all png files in current folder and will make thumbnails (shrink) any image that has a width larger than say 200 pixels. The height of the image is adjusted so that aspect ratio remain the same as originally was.
Edit as needed
#!/bin/bash shopt -s nullglob FILES=*.png for file in $FILES do f=${file%.*} echo "file is $file and f is $f" convert "$f.png[200x>]" "$f"_thumb.png done
This example is as above except that the resizing is limited to enlarging the images to say 200 pixels. Edit as needed
#!/bin/bash shopt -s nullglob FILES=*.png for file in $FILES do f=${file%.*} echo "file is $file and f is $f" convert "$f.png[200x<]" "$f"_thumb.png done
Reference: