This is a small bash script to decrease resolution of JPG photo or other image files. It searches all .JPG files recursively from the current directory . and the converts them to 1200 pixel wide. It uses ImageMagick’s convert tool, so you will need imagemagick package to execute this command. By changing the search pattern and the expected resolution you can customize it to you needs…

find . -iname "*.JPG" | while read f; do convert -resize 1200 "$f" "$f"; done