Skip to content

Instantly share code, notes, and snippets.

@hbulens
Created December 5, 2022 08:43
Show Gist options
  • Save hbulens/9bc6246e146e226922e0723a18e2935f to your computer and use it in GitHub Desktop.
Save hbulens/9bc6246e146e226922e0723a18e2935f to your computer and use it in GitHub Desktop.
Recursive compress images using imagemagick
param(
[Parameter(Mandatory=$true)]
[String]$path
)
Get-ChildItem –Path $path –Recurse -Include *.png,*.jpg,*.bmp | Foreach-Object {
magick $_.FullName -strip -interlace Plane -gaussian-blur 0.05 -quality 85% $_.FullName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment