Created
February 20, 2026 05:27
-
-
Save duodecanol/a7184c5ad88670657d8d6ac28bad88ce to your computer and use it in GitHub Desktop.
Convert png to webp subfolders using parallel and cwebp
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
| find . -name "*.png" -print0 | parallel -0 ' [14:26:20] | |
| dir=$(dirname {}) | |
| file=$(basename {}) | |
| parent_dir=$(basename "$dir") | |
| new_basepath="${parent_dir}-webp" | |
| mkdir -p "${new_basepath}" | |
| new_name="${new_basepath}/${file}" | |
| cwebp -q 100 {} -o "${new_name}.webp" | |
| ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment