Missing .icns sizes?

Does anyone know definitively if 48x48 and 64x64 standard and retina versions are required for a .icns file?
Some people say yes they are needed, but others say no - just 16x16, 32x32, 128x128, 256x256, and 512x512 (and the @2x versions).

I cannot seem to get a straight answer on this :frowning:

Thank you.

I use the command line iconutil tool and these sizes:

icon_128x128.png icon_128x128@2x.png icon_16x16.png icon_16x16@2x.png icon_256x256.png icon_256x256@2x.png icon_32x32.png icon_32x32@2x.png icon_512x512.png icon_512x512@2x.png

The resulting icns file scales from the lowest to the highest sizes very cleanly.

That is also what I use, but lots of people also say that 48x48 and 64x64 should be included?

Not according to the HIG. Those go back to the days of hardcoded icon sizes.

From High Resolution Guidelines for OS X

[quote]Create a Set of Icons That Includes High-Resolution Versions
You should create a set of icons that consist of pairs of icons (standard and high resolution) for each icon size—16x16, 32x32, 128x128, 256x256, 512x512. The naming convention is:

icon_x[@].png

where is the size of the icon in points, and is @2x for the high-resolution version. (Don’t add a scale for standard resolution.) Additionally, the filename must use the icon_ prefix.

The images must be square and have the dimensions that match the name of the file.

Ideally, you would supply a complete set of icons. However, it is not a requirement to have a complete set; the system will choose the best representation for sizes and resolutions that you don’t supply. Each icon in the set is a hint to the system as to the best representation to use. A complete set consists of the following:

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
icon_512x512.png
icon_512x512@2x.png[/quote]

48 is 16x16@3x.

Actually, 3x is used for the iPhone, but could come to Mac OSX one of these days.

@3x is used for iPhone but I believe only for iOS8, and only if supporting iPhone6.

indeed. But knowing Apple never stops innovating, one of these days we may have a Retina 3x laptop.

The 48 size I believe comes from icon designers who create each size; 48x48 is a standard for Windows so professional icon designers will create that size. I’m not sure it was ever preferred on a Mac, but the Dock will use it if available.

Ok - this is weird.

I have a folder full of images - f2 refers to the path.

I have the code below which converts all of the images in the folder in to a .icns file:
However - when I view the .icns file - there are only 9 images and not the expected 10???
It only has 1 image sized 512 (as opposed to the expected 2).

Does anyone have any ideas?

[code]// ---------------------------------------- CREATE PROPER FOLDER TO HOLD THE PNGS FOR CONVERSION
s.Execute(“mkdir “+f2.shellpath+”/mypng.iconset”)
s.Execute(“touch “+f2.shellpath+”/myicon.icns”)

Dim iconSetFolder as FolderItem = F2.Child(“mypng.iconset”)
Dim iconICNSFile as FolderItem = F2.Child(“myicon.icns”)

// COPY ALL PNG FILES TO THE NEW iconSetFolder FOLDER
S.Execute("cp “+f2.ShellPath+”/*.png "+iconSetFolder.ShellPath)

// CONVERT
s.Execute("iconutil -c icns “+iconSetFolder.ShellPath+” -o "+iconICNSFile.ShellPath)[/code]

Alternatively, does anyone have a better way of converting all images inside a folder (f2) to a .icns file?

P.S - I want to do this inside of Xojo - (not via a 3rd party app).

Thank you all in advance.

[quote=149435:@Richard Summers]Ok - this is weird.

I have a folder full of images - f2 refers to the path.

I have the code below which converts all of the images in the folder in to a .icns file:
However - when I view the .icns file - there are only 9 images and not the expected 10???
It only has 1 image sized 512 (as opposed to the expected 2).

Does anyone have any ideas?

[code]// ---------------------------------------- CREATE PROPER FOLDER TO HOLD THE PNGS FOR CONVERSION
s.Execute(“mkdir “+f2.shellpath+”/mypng.iconset”)
s.Execute(“touch “+f2.shellpath+”/myicon.icns”)

Dim iconSetFolder as FolderItem = F2.Child(“mypng.iconset”)
Dim iconICNSFile as FolderItem = F2.Child(“myicon.icns”)

// COPY ALL PNG FILES TO THE NEW iconSetFolder FOLDER
S.Execute("cp “+f2.ShellPath+”/*.png "+iconSetFolder.ShellPath)

// CONVERT
s.Execute("iconutil -c icns “+iconSetFolder.ShellPath+” -o "+iconICNSFile.ShellPath)[/code]

Alternatively, does anyone have a better way of converting all images inside a folder (f2) to a .icns file?

P.S - I want to do this inside of Xojo - (not via a 3rd party app).

Thank you all in advance.[/quote]
Is your mac possessed? :slight_smile:

The gloves are coming off !

Even Iconutil via the terminal only inserts 8 of the 10 images into the .icns???

I even just tried this:

I opened terminal and typed in this: iconutil -c icns
I then pressed the spacebar, and then dropped a folder of 10 images onto the terminal window. The .icns file was created on the desktop BUT it contained 9 of the 10 images???

Can anyone please confirm this.

Create a folder containing the 10 image files needed for a .icns file, and then use iconutil to create the file.
I NEVER get ALL of the images from the folder inside the .icns file - there is always one missing?

Thank you all in advance.

which one?

Hi all,

Get info for one Apple application (say TextEdit),
run Preview
cmd-n
cmd-i

and watch carefully at what you get in the icns file.

Warning: You will get all sizes up to 10214 x 1024 (Was 512 x 512 long time ago),
WARNING: you will get some images at the same 1024 x 1024, but at 144 dpi.

It may be a good idea to check before writing and sending answers.
Oh, btw: the icon look was changed in Yosemite (but not the size as far as I saw before sending my MacBook Pro at repair a 12 days ago).

[quote=149497:@Richard Summers]Create a folder containing the 10 image files needed for a .icns file, and then use iconutil to create the file.
I NEVER get ALL of the images from the folder inside the .icns file - there is always one missing?
[/quote]

I suspect iconedit is astute enough to recognize when 2x pictures are the same as a larger one. For instance, in Tim’s list above, there are several 2x pictures that are identical to larger ones :

icon_128x128.png icon_128x128@2x.png // Same as 256x256 icon_16x16.png icon_16x16@2x.png // same as 32x32 icon_256x256.png icon_256x256@2x.png // same as 512x512 icon_32x32.png icon_32x32@2x.png icon_512x512.png icon_512x512@2x.png

This list of 10 files will probably result in 7 pictures inside the icns, because some of them are redundant.

Michel,

as far as I know, icns files are OS X file and so have entries as large as 1024 x 1024. Read my previous answer.

Redundant ? No, they are not.

[quote=149550:@Emile Schwarz]Michel,

as far as I know, icns files are OS X file and so have entries as large as 1024 x 1024. Read my previous answer.

Redundant ? No, they are not.[/quote]

Think, Emile. 128x128@2x.png is in fact a 256x256 picture. How is it different from 256x256.png ?
Inside the icns, and unless I am mistaken, there is only one copy of each picture size…

128x128@2x.png is in fact a 256x256 picture
So white is in fact a simple shade of grey (the last one whithout grey) ?
;-:slight_smile:
Oh, and what is 128x128@2x.png (in an icns file ?)

Check more carefully. Hint: get an eye in the image dpi…

Remember: I do not have an OS X machine handly, actually.

[quote=149554:@Emile Schwarz]>128x128@2x.png is in fact a 256x256 picture
So white is in fact a simple shade of grey (the last one whithout grey) ?
;-:slight_smile:
Oh, and what is 128x128@2x.png (in an icns file ?)

Check more carefully. Hint: get an eye in the image dpi…

Remember: I do not have an OS X machine handly, actually.[/quote]

Emile, yes, white is a shade of grey.

For all intents and purposes, 128x128@2x.png is a 256x256 pixels picture. If you do not understand that 144 dpi = 2 x 72 dpi this is your problem here. And I do not need your professoral and confused hint, thank you.

You have a way of complexifying simple things that never ceases to amaze me…