Create a macOS .icns Icon with iconutil and sips
Generate all required icon sizes from one PNG and bundle them into an .icns file.
Resize your PNG into an Icon.iconset folder with sips, then run iconutil -c icns Icon.iconset -o Icon.icns.
01Command
Command
$ mkdir -p Icon.iconset && for s in 16 32 128 256 512; do sips -z $s $s icon.png --out Icon.iconset/icon_${s}x${s}.png; done && iconutil -c icns Icon.iconset -o Icon.icns02What it does
macOS icons are .icns bundles containing the same artwork at several sizes, and the built-in iconutil assembles one from a special .iconset folder. The loop resizes your source PNG into the standard 16/32/128/256/512 pixel sizes with sips; iconutil then packs everything into Icon.icns. Use a 1024×1024 source image for best results.
03Risk
!Warning: Filenames inside the .iconset folder must follow Apple's exact naming pattern (icon_16x16.png, icon_32x32.png, …) or iconutil refuses the folder. For Retina-ready icons also generate the @2x variants.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- iconutil(1) macOS Manual PageEvidence: Documents iconutil -c icns converting an .iconset folder of sized PNGs into an .icns file.
- sips - scriptable image processing systemEvidence: Documents the sips -z resizing used to generate the icon size set.
Last verified: 2026-09-18 · Category: Media