#!/bin/bash
for fname in *.jpg; do
mogrify -resize 640x640 -quality 80 $fname
composite -compose atop -gravity SouthEast logo.png $fname $fname
done