To create a macOS .icns icon from a single source PNG, you must first generate an .iconset directory containing multiple appropriately sized PNG files, then use the macOS iconutil command to compile them.
- Generate the iconset folder: Use the
generate-iconset.py script to create a folder containing 10 different dimensions of the icon. - Compile to .icns: Use
iconutil to convert the folder into a single .icns file.
Note: This process requires python3 and the generate-iconset.py script.
# 1. Create the iconset folder
python3 generate-iconset.py ~/Desktop/chuck.png
# 2. Compile the iconset into a .icns file
iconutil -c icns ~/Desktop/chuck.iconset -o ~/Desktop/chuck.icns