Created
July 8, 2024 05:37
-
-
Save chrisvogt/445a50c21b07e9fd46280ac1028050c9 to your computer and use it in GitHub Desktop.
Converts all .jpg images in the current directory to .webp format with the quality set to 90 and output them to a webp-90 subdirectory:
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
mkdir -p webp-90 | |
for filepath in *.jpg; do | |
filename=$(basename "$filepath" .jpg) | |
cwebp -q 90 "$filepath" -o "webp-90/$filename.webp" | |
echo "Converted $filepath to webp-90/$filename.webp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment