How to manually create icns files using iconutil?

iconutil failed to generate icns
convert png to icns mac online
edit icns file
iconutil windows
imagemagick icns
icns bad dimensions
mac icns
icns image

When I'm validating my app I get this error:

the application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image.

I use to make the icns icons with Img2icns app and until today it always worked properly. But now I'm getting that error and there's no way to make it work. I tried to put two PNG files together (512x512 and 1024x1024) in Img2icns but I always get that error. I also tried to follow the instructions in Apple's OS X Human Interface Guideline but when I try to make the icon sets I get this terminal error:

-bash: syntax error near unexpected token 'newline'

I am not very good with terminal commands so maybe I'm doing something wrong. I wrote:

iconutil -c icns </Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset>

If anyone could help it would be very much appreciated. Thanks, Massy.

Checkout the following instructions (link):

Use iconutil to Create an icns File Manually

The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. (You can find complete documentation for this tool by entering man iconutil in Terminal.) Using this tool also compresses the resulting icns file, so there is no need for you to perform additional compression.

To convert a set of icons to an icns file

Enter this command into the Terminal window:

iconutil -c icns <iconset filename>

where <iconset filename> is the path to the folder containing the set of icons you want to convert to icns. The output is written to the same location as the iconset file, unless you specify an output file as shown:

iconutil -c icns -o <icon filename> <iconset filename>

In other words, you need to replace <iconset filename> by the path:

/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset

Since the path contains spaces, you need to use double quotes, for example:

iconutil -c icns "/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset"

This command should work properly.

Creating OS X document icons or: how to convert an icns file to png , You can also use the iconutil tool manually and, even better: it also allows you to create an iconset folder with png files from an icns file! Just use  Use iconutil to Create an icns File Manually. The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. (You can find complete documentation for this tool by entering man iconutil in Terminal.) Using this tool also compresses the resulting icns file, so there is no need for you to perform additional compression.

Here's a script to convert a 1024x1024 png (named "Icon1024.png") to the required icns file. Save it to a filed called "CreateICNS.src" in the folder where your png file is then in terminal "cd" to the same folder and type "source CreateICNS.src" to call it:

mkdir MyIcon.iconset
sips -z 16 16     Icon1024.png --out MyIcon.iconset/icon_16x16.png
sips -z 32 32     Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png
sips -z 32 32     Icon1024.png --out MyIcon.iconset/icon_32x32.png
sips -z 64 64     Icon1024.png --out MyIcon.iconset/icon_32x32@2x.png
sips -z 128 128   Icon1024.png --out MyIcon.iconset/icon_128x128.png
sips -z 256 256   Icon1024.png --out MyIcon.iconset/icon_128x128@2x.png
sips -z 256 256   Icon1024.png --out MyIcon.iconset/icon_256x256.png
sips -z 512 512   Icon1024.png --out MyIcon.iconset/icon_256x256@2x.png
sips -z 512 512   Icon1024.png --out MyIcon.iconset/icon_512x512.png
cp Icon1024.png MyIcon.iconset/icon_512x512@2x.png
iconutil -c icns MyIcon.iconset
rm -R MyIcon.iconset

How to manually create icns files using iconutil?, Use iconutil to Create an icns File Manually. The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. (You can​  To convert a set of icons to an icns file. Enter this command into the Terminal window: iconutil -c icns <iconset filename>. where <iconset filename> is the path to the folder containing the set of icons you want to convert to icns.

There's a command-line node module that does all the work of converting a PNG file into an iconset directory:

npm install -g node-icns
nicns --in adventure-cat.png --out adventure-cat.icns

Convert PNG to ICNS on Mac OS, Use iconutil to Create an icns File Manually. The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns  How to manually create icns files using iconutil? 1; English

While using all kinds of scripts to convert hi-res PNG image to a pleiad of different low-resolution copies may seem handy (and it really is), one should not forget that this kind of automatic resizing will render perceptibly imperfect images.

The lesser the resolution, the blurrier the icon!

Instead, you should always request a logo in some vector format from your designer, for example in SVG. With this on hand, you can manually prepare perfect PNG files in all required resolutions and then make a single .icns file, which will make your app icon look beautiful on every single screen, from mobile phone to some high-end Retina display of the latest iMac.

From the latest Apple guideline as of 2016, you should prepare the following PNG files:

+---------------------+--------------------+--------------+
|      filename       | resolution, pixels | density, PPI |
+---------------------+--------------------+--------------+
| icon_16x16.png      | 16x16              |           72 |
| icon_16x16@2x.png   | 32x32              |          144 |
| icon_32x32.png      | 32x32              |           72 |
| icon_32x32@2x.png   | 64x64              |          144 |
| icon_128x128.png    | 128x128            |           72 |
| icon_128x128@2x.png | 256x256            |          144 |
| icon_256x256.png    | 256x256            |           72 |
| icon_256x256@2x.png | 512x512            |          144 |
| icon_512x512.png    | 512x512            |           72 |
| icon_512x512@2x.png | 1024x1024          |          144 |
+---------------------+--------------------+--------------+

After all the PNG files are prepared, place them into some directory with .iconset extension (Logos.iconset for example) and execute the following from the Terminal:

iconutil --convert icns Logos.iconset

If there were no errors after executing this command, then all the files were processed properly, and you got the Logos.icns file in the same directory, containing all the beautiful crisp logos for your app which will suit any modern screen as of 2017.

xcode How to manually create icns files using iconutil?, the application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image. I use to make the icns icons with  In my case, “rocketyard.icns” was made on my desktop. This is the file we want. Use the ICNS file to customize your file icons. The most common way to swap icons in OS X has generally been the copy/paste method we describe on our Drive Icons page. As long as the item you’re copying has the icon pasted on a folder or file (like our drive icon packs do) you should have no trouble copying and pasting to an new folder or drive.

These commands (entered in Terminal) worked for me to convert an old icns file to the new format:

cd Folder_With_Icns_File
iconutil -c iconset Your_Icon_Name.icns 
rm Your_Icon_Name.icns 
iconutil -c icns Your_Icon_Name.iconset
rm -R Your_Icon_Name.iconset
Update

The -c parameter to iconutil is no longer supported. Use --convert instead:

cd Folder_With_Icns_File
iconutil --convert iconset Your_Icon_Name.icns 
rm Your_Icon_Name.icns 
iconutil --convert icns Your_Icon_Name.iconset
rm -R Your_Icon_Name.iconset

How to manually create icns files using iconutil?, iconutil -c icns some.png some.png:Iconset not found. But that's rather boring to create all those files manually in some graphics editor, right? When you pass .png files through iconutil(), these files must be named like icon_512x512.png or icon_128x128@2x.png.. Create .icns from .sketch w/ gulp-sketch.sketch files, which use for creating icons, must have artboard or slice named like icon_512x512 or icon_128x128.

iconutil |, Apple docs say "Note: Dont use Icon Composerit cant create high-resolution icns files.". That is, the @2x icons can't be done that way. Apple's older Icon  Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.Provide details and share your research! But avoid …. Asking for help, clarification, or responding to other answers.

automator-workflows/README.md at master · sparanoid/automator , (link): Use iconutil to Create an icns File Manually The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. Creating ICNS files can also be done using the old IconFamily API, but it's a bit hairy. Also, it doesn't support high-resolution icons. First, you create a handle (pointer-to-pointer-to-resizable-buffer) for the icon family: IconFamilyHandle iconFamily = (IconFamilyHandle)NewHandle(0);

If you want to create your own, you can use a free app like GIMP or Inkscape if you don't have Hence, the file extension 'icns' (and not 'icn'), with the 's' for 'set'. 3. You can either do this manually or use the shortcut 'Command-Shift-S'. A short video showing how to create custom icon files with extension ICNS in Mac OS X. This uses no special software other than an image editing program like Photoshop. Here's the location of Mac

Comments
  • I built an app which wraps iconutil to make this easy: hobbyistsoftware.com/icontool
  • You probably don't need to use iconutil, though. You can just add the iconset to your project and let Xcode convert it for you as part of the build. That's covered in the immediately previous (very short) section: developer.apple.com/library/mac/documentation/GraphicsAnimation/…
  • @Anne: except the iconutil command is only included with the OS versions that don't use ICNS files... No love for us who use OS10.6.8 V1.1... it's an even worse 'our way or the highway' for the devs than the users.
  • @Anne: That worked... thanks a lot! (also thanks for setting my question properly). Peace, Massy
  • @HenrikErlandsson: All versions of Mac OS X use .icns files, all the way back to 10.0.
  • The following files should exist: icon_16x16.png, icon_16x16@2x.png, icon_32x32.png, icon_32x32@2x.png, icon_128x128.png, icon_128x128@2x.png, icon_256x256.png, icon_256x256@2x.png. The @2x files should be stored at 144 pixels per inch while the others should be stored at 72 pixels per inch.
  • Superb. i put Icon1024.png on desktop , and just run your code and it done all
  • Wonderful! Thanks! How would I modify this if I wanted to put it in a directory with folders called File.iconset, Images.iconset, Misc.iconset and so on. Each .iconset folder would contain an Icon1024.png and the script would roll through each folder generating the icons.
  • Is it possible that this perfect little script has been broken in El Capitan? Upgraded my Mac to 10.11.3 and this script now returns "error: Unsuported image format" then "/Users/IconScript/MyIcon-osx.iconset:error: Variant named 'icon' contains no image resources." then "MyIcon-osx.iconset:error: Failed to generate ICNS." Tried the same script and .png file on a Mac that is not updated to El Capitan and it worked there as always... =(
  • Yeah @Henry, I was just removing the folder names to try and make the comment cleaner, I am running it in the Terminal from within the folder that contains the src script and icons. The only thing different than before is El Capitan vs Yosemite... I literally used the script before updating the OS with success and then right after updating (in the same folder, same Terminal commands) and it now returns that error. Have you had success with it on El Capitan?
  • Important things to note: Your icon image filenames must start with "icon_". The images must have an alpha channel. You can add an alpha channel with ImageMagick if needed convert abc.png -define png:color-type=6 abc_with_alpha.png.
  • No longer supported. :(
  • Thanks for showing this, thanks to this i was able to reverse from icns to get the pngs! :)
  • Awesome! Dead simple :) perhaps make it a .sh/script would make it even more :) Thanks!