Skip to content

Instantly share code, notes, and snippets.

@ronsen
Created February 18, 2026 05:06
Show Gist options
  • Select an option

  • Save ronsen/2cc2784f5c646506f780c54ea4d4532b to your computer and use it in GitHub Desktop.

Select an option

Save ronsen/2cc2784f5c646506f780c54ea4d4532b to your computer and use it in GitHub Desktop.
Resize image size
#!/usr/bin/env bash
shopt -s nocaseglob
total=$(ls -1 *.jpg 2>/dev/null | wc -l)
current=0
for i in *.jpg; do
((current++))
percentage=$((current * 100 / total))
echo -ne "Resizing ($total images): $percentage%\r"
magick "$i" -resize 50% -quality 76 "$i"
done
shopt -u nocaseglob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment