Last active
April 9, 2025 08:43
-
-
Save AkiyukiOkayasu/9d17bf4992a260dbb5df9f567b44b76b to your computer and use it in GitHub Desktop.
ディレクトリのJPGファイルをwebpやAVIFに一括変換
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
| for file (*.JPG) { (avifenc -j all $file -o $file:r.avif) & } |
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
| # Lossy JXL | |
| mkdir lossy_jxl; find . -name "*.jpg" -print0 | xargs -0 -P 4 -I {} sh -c 'cjxl --lossless_jpeg=0 "$1" "lossy_jxl/${1%.jpg}.jxl"' sh {} | |
| # Lossless JXL | |
| mkdir lossless_jxl; find . -name "*.jpg" -print0 | xargs -0 -P 4 -I {} sh -c 'cjxl --lossless_jpeg=1 "$1" "lossless_jxl/${1%.jpg}.jxl"' sh {} |
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
| # Lossy WEBP | |
| mkdir webp; find . -name "*.jpg" -print0 | xargs -0 -P 4 -I {} sh -c 'cwebp -metadata all -sharp_yuv "$1" -o "webp/${1%.jpg}.webp"' sh {} | |
| # Lossless WEBP | |
| for file (*.JPG) { (cwebp -lossless -metadata all $file -o $file:r.webp) & } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment