Skip to content

Instantly share code, notes, and snippets.

@jim60105
Last active May 4, 2023 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim60105/e8e84477377da19d007d443c46c8df6c to your computer and use it in GitHub Desktop.
Save jim60105/e8e84477377da19d007d443c46c8df6c to your computer and use it in GitHub Desktop.
$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 ""
}
@jim60105
Copy link
Author

jim60105 commented May 2, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment