Created
October 1, 2021 22:40
-
-
Save yutsuku/152f91d2e68c6402b7e4e114f1083391 to your computer and use it in GitHub Desktop.
powershell_autocrop.ps1
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
# Auto crop images to bounding box using imagemagick | |
# You can use scoop to install imagemagick => "scoop install imagemagick" | |
# Change path and file extension! | |
Get-ChildItem -Recurse -File -Path "E:\images path\" -Include *.png | ForEach-Object { | |
$Path = Join-Path -Path 'E:\images path\cropped' -ChildPath $_.Name | |
C:\Users\moh\scoop\apps\imagemagick\current\convert.exe "`"$($_.FullName)`"" -fuzz 5% -trim +repage "`"$Path`"" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment