Last active
January 3, 2023 06:54
-
-
Save spajak/3c80d338e363715cbbc16f3b998a0ada to your computer and use it in GitHub Desktop.
Simple script to convert PNG image to Windows ICO format using ImageMagick
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
param( | |
[String] $png | |
) | |
$root = Split-Path "$png" -Parent | |
$name = Split-Path "$png" -LeafBase | |
$icon = Join-Path $root ($name + ".ico") | |
& magick "$png" -strip -background none ` | |
-gravity center -extent "%[fx:max(w,h)]x%[fx:max(w,h)]" ` | |
-define icon:auto-resize=16,24,32,48,64,128 "$icon" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment