Created
May 11, 2023 19:34
-
-
Save riskiwah/0a017e417fd184efa8da01373883212e to your computer and use it in GitHub Desktop.
webp convert
This file contains 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
#!/bin/bash | |
for image in $PWD/**/*.{png,jpg,jpeg}; do | |
if [[ $image != *"webp"* ]]; then | |
cwebp -q 80 "$image" -o "${image%.*}.webp" | |
echo "Converted $image to ${image%.*}.webp" | |
rm "$image" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment