Convert and resize all *.jpg images to *.png thumbnails
This will convert and resize all *.jpg images in the current directory to *.png images. Perfect for creating smaller thumbnails in large image directories. See the Linux manual pages "man bash", "man find", "man read", "man convert" and "man sed".
All filename results from find are piped line by line to read and then processed by convert, editing the new filename with sed. This ensures that all paths with whitespace characters are processed correctly.
find . -type f -name '*.jpg' | while read filename; do echo "converting ${filename}"; convert -size 128x128 -resize 128x128 +profile '*' "${filename}" "`echo "${filename}" | sed -e 's/\.jpg$/\.png/'`"; done
