Created
November 20, 2022 22:10
-
-
Save lincerely/b7f4e61e3063e6edbff370103c781091 to your computer and use it in GitHub Desktop.
convert any image to .icns with imagemagick on macOS
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
| #!/usr/bin/env bash | |
| # convert any image to .icns with imagemagick | |
| # refs: https://www.imagemagick.org/Usage/resize/#fill | |
| # https://www.imagemagick.org/Usage/thumbnails/#fit_summery | |
| if [ $# -ne 1 ]; then | |
| echo usage: img2icns.sh IMG | |
| exit 1 | |
| fi | |
| magick "$1" -resize 512x512 -gravity center \ | |
| -background transparent -extent 512x512 "$1".tiff && \ | |
| tiff2icns "$1".tiff && \ | |
| rm "$1".tiff |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
better alternative: just
convert *.ico icons.icns