Convert a directory of PNGs to JPEGs:
for file in `ls *.png`
do
extension="${file##*.}"
base="${file%.*}"
convert "$file" -quality 60 "${base}.jpg"
done
Crop transparent border around edges:
convert image -trim +repage output
Crop border around edges with fuzziness:
convert image -fuzz 1% -trim +repage output