Created
February 18, 2026 05:06
-
-
Save ronsen/2cc2784f5c646506f780c54ea4d4532b to your computer and use it in GitHub Desktop.
Resize image size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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