Last active
May 4, 2023 21:51
-
-
Save jim60105/e8e84477377da19d007d443c46c8df6c to your computer and use it in GitHub Desktop.
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
$sourceFolder = "${pwd}\*" | |
$filePatterns = '*.png','*.jpg','*.gif' | |
Get-ChildItem -Path $sourceFolder -Include $filePatterns -File -Recurse | ForEach-Object { | |
$name = $_.FullName | |
$webp = [System.IO.Path]::ChangeExtension($name,".webp") | |
$avif = [System.IO.Path]::ChangeExtension($name,".avif") | |
echo "Orig: $name" | |
echo "WebP: $webp" | |
magick "$name" "$webp" | |
echo "AVIF: $avif" | |
magick -define "heic:speed=2" "$name" "$avif" | |
echo "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See 如何使用 ImageMagick 批次將 PNG 圖片轉檔成 AVIF 與 WebP 格式