Reduce pictures quality for multiple files

a) In a directory where you have a lot of pictures, create a script img_quality.sh and launch it

mkdir output
convert *.jpg -interlace line -quality 30 -resize 50% output/*.jpg
for x in *.JPG; do mv "$x" "${x%.JPG}.jpg"; done