Skip to content

Instantly share code, notes, and snippets.

Last active February 2, 2020 11:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Convert a PNG to a macOS ICNS file
#The image you want to make into a macOS ICNS file
#Make sure there is an alpha layer or the iconutil command will fail
mkdir icon.iconset
# resize all the images
sips -z 16 16 $orig --out icon.iconset/icon_16x16.png
sips -z 32 32 $orig --out icon.iconset/icon_16x16@2x.png
sips -z 32 32 $orig --out icon.iconset/icon_32x32.png
sips -z 64 64 $orig --out icon.iconset/icon_32x32@2x.png
sips -z 128 128 $orig --out icon.iconset/icon_128x128.png
sips -z 256 256 $orig --out icon.iconset/icon_128x128@2x.png
sips -z 256 256 $orig --out icon.iconset/icon_256x256.png
sips -z 512 512 $orig --out icon.iconset/icon_256x256@2x.png
sips -z 512 512 $orig --out icon.iconset/icon_512x512.png
sips -z 1024 1024 $orig --out icon.iconset/icon_512x512@2x.png
sips -z 1024 1024 $orig --out icon.iconset/icon_1024x1024.png
# create the .icns
iconutil -c icns icon.iconset
# remove the temp folder
rm -R icon.iconset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment