Last active
November 10, 2020 22:38
-
-
Save Nooshu/fd6c0f1f1a80bd50c47d4c755e8b46a6 to your computer and use it in GitHub Desktop.
Find all PNG's in a directory, convert to WebP / AVIF. Output using the same filename.
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
## WebP | |
find ./ -type f -name '*.png' -exec sh -c 'cwebp -lossless $1 -o "${1%.png}.webp"' _ {} \;\n | |
## AVIF (s=speed / 0-10 / slowest-fastest) | |
find ./ -type f -name '*.png' -exec sh -c 'avifenc -s 6 $1 -o "${1%.png}.avif"' _ {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment