Created
December 21, 2021 04:13
-
-
Save gyk/f2aeb41a735e8e499d612ef5138ba966 to your computer and use it in GitHub Desktop.
Convert SVG files in a directory into ICOs using ImageMagick
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
$magickExe = 'C:\Program Files\ImageMagick-7.1.0-Q16-HDRI\magick.exe' | |
$inPath = 'C:\Users\Joe\Downloads\svg-icons\' | |
$outPath = 'C:\Users\Joe\Downloads\svg-icons\output\' | |
foreach ($file in Get-ChildItem -File $inPath) | |
{ | |
Write-Host "Processing ", $file | |
$outName = [io.path]::ChangeExtension($file.Name, "ico") | |
& $magickExe -density 256 -background transparent $file -define icon:auto-resize='64,32,16' -colors 8 (Join-Path $outPath $outName) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment