Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

boredandlonely

macrumors regular
Original poster
Aug 28, 2008
128
19
I'm trying to learn ICNS and I'm a bit stuck.
I'm trying to get custom ICNS that will show on my drives during Option-Boot (High Sierra, Mojave, Big Sur).

I've generated multiple ICNS files, using Photoshop, Preview, scripts, and/or apps, and they show on my drives everywhere BUT option-boot.

I have a working sample ICNS file, and the size that loads during boot is 128x128 @ 72dpi, however, my various created ICNS including that size are NOT showing it during boot.

In Preview. using the working sample ICNS file, I cut (cmd-x) the selected working 128x128 @ 72 (right side window), and pasted (cmd-v) in my own PNG (also 128x128 @ 72) and that shows correctly during boot! But the exact same size in any of my created ICNS, will NOT show during boot.

1. Is there a free app/script/method to generate ICNS that DO SHOW at boot? (hopefully not too difficult to use)

2. What's wrong with my own 128x128 @ 72dpi vs. my working sample's 128x128 @ 72? (all other sizes work perfectly as-is)


Re: 2 above... Using Preview's inspector window on working(a) and failing(b) ICNS files shows (see images):​
If it matters, I also noticed (a) is in the "3" thumbnail position of the ICNS. (b) is in the "6" thumbnail position of the ICNS.​
a. (works)
Screenshot 2023-11-27 at 4.16.23 PM.png
b. (fails)
Screenshot 2023-11-27 at 4.16.28 PM.png
 
Last edited:
What Mac do you have? Different versions of EFI and macOS have different limits for the icns.
Code:
.VolumeIcon.icns requirements:
- 10.4: icons in an icns file cannot be 300KB or greater otherwise the icns is not used. 1024x1024 icons are usually too large. Some 512x512 icons are too large (depends on png compressibility).
- 10.5: The icns file cannot exceed 1MB-2B otherwise the icns is not used.
- 10.6: no limits that I've encountered
- 10.7: TOC must be ordered if it exists
- 10.8: TOC must be ordered if it exists
- 10.9 - 12.2: no limits that I've encountered
- Startup Manager on old Macs like my MacPro3,1 require it32 icons (at least for the 128x128 size - I haven't checked what icon types can be used)
- rEFInd doesn't do icons that have png or jpeg or ARGB data - it only does the RGB+8 icon types (it32 and it's smaller versions).
- I added support for png and ARGB to my RefindPlus fork (plus old 8bit, 4bit, 1bit icons! I tested these by converting all icons in a Mac OS 9
  system file and ROM resources into icns files). I don't know where to get a jpeg 2000 library that can be ported to EFI to support icns files that have jpeg 2000 icons.

Maybe try the instructions at https://gist.github.com/joevt/9fa52...malink_comment_id=4006225#gistcomment-4006225
 
Thanks for the reply but I think a lot of that script code is going to be over my head for the moment. I could probably run it, but would need instructions -lol. Looking at requirements first...

I'm on a MacbookPro6,1
10.13.6 native
10.14.6 Unsupported dosdude
11.7.10 OCLP

Re: requirements
How do I change an "ic07" to an "it32"? That looks suspiciously applicable, but not seeing anything on google I can read up about it.
 
Last edited:
Below is a list of commands. They do the following:
  • Makes a icons directory in your user folder where it will download the scripts and tools.
  • Downloads osxiconutils and builds all the targets using Xcode. It has tools for converting icon images.
  • Downloads DiskUtil.sh which is used to mount all the partitions.
  • Downloads VolumeIconUtil.sh which is used to check the volume icon on each partition.
  • Updates the VolumeIconUtil.sh script so that it uses the osxiconutils that were just built.
  • Loads the commands from the DiskUtil.sh and VolumeIconUtil.sh scripts. These remain only while the Terminal.app window is open.
  • Uses the mount commands from DiskUtil.sh to mount all the partitions.
  • Uses the checkiconcompatibility command from VolumeIconUtil.sh to copy and check the .VolumeIcon.icns from each partition. They are copied to ~/icons/VolumeIcons1. If an icon is missing an it32 then it will add it to a new icon file and generate a copy command (cp) for you to use to replace the .VolumeIcon.icns file. You may need to add sudo to the copy command for some partitions.

Code:
mkdir -p ~/icons
cd ~/icons
git clone https://github.com/joevt/osxiconutils
cd osxiconutils
xcodebuild -alltargets
cd ~/icons
curl -L https://gist.github.com/joevt/6d7a0ede45106345a39bdfa0ac10ffd6/raw -o DiskUtil.sh
curl -L https://gist.github.com/joevt/9fa524ebbef3db46842f14f33cf64ca5/raw -o VolumeIconUtil.sh
perl -i -pE "s|/Volumes.*Debug/|~/icons/osxiconutils/build/Release/|" ~/icons/VolumeIconUtil.sh
source DiskUtil.sh
source VolumeIconUtil.sh
mountEFIpartitions
mountPrebootPartitions
mountRecoveryPartitions
mountRecoveryHDpartitions
checkiconcompatibility

After you've replaced any problematic icon files, you can use checkiconcompatibility again to verify the results. It will use a new folder ~/icons/VolumeIcons2 for the results. It might complain that the new icon files contains icons that are too large. In that case, it will generate a makeicon command, which you can use to create a copy of the icns file without the large icon, and a cp command you can use to replace the .VolumeIcon.icns file.

You can use checkiconcompatibility again to verify the results. It will use a new folder ~/icons/VolumeIcons3 for the results.
 
After you've replaced any problematic icon files, you can use checkiconcompatibility again to verify the results. It will use a new folder ~/icons/VolumeIcons2 for the results. It might complain that the new icon files contains icons that are too large. In that case, it will generate a makeicon command, which you can use to create a copy of the icns file without the large icon, and a cp command you can use to replace the .VolumeIcon.icns file.

You can use checkiconcompatibility again to verify the results. It will use a new folder ~/icons/VolumeIcons3 for the results.

Uses the checkiconcompatibility command from VolumeIconUtil.sh to copy and check the .VolumeIcon.icns from each partition. They are copied to ~/icons/VolumeIcons1. If an icon is missing an it32 then it will add it to a new icon file and generate a copy command (cp) for you to use to replace the .VolumeIcon.icns file. You may need to add sudo to the copy command for some partitions.


Edit: Fixed Preview

Ok, thank you for the instructions spelled out perfectly. I made it to the last step before I had questions.

I have 1 icns that got pulled, but I was totally happy with that icon, (displays everywhere it should) so not sure why it was pulled. I can't see any differences between the new and old exccept the "after" file actually has a corrupt image now for the 128x128...

1. Am I supposed to keep the 2 ".txt" files for something?

2. I tried the other script you linked before and it looks like I need to modify it first and/or install more stuff?
-bash: /Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/image2icns: No such file or directory

Thanks
 
Last edited:
Edit: Fixed Preview

Ok, thank you for the instructions spelled out perfectly. I made it to the last step before I had questions.

I have 1 icns that got pulled, but I was totally happy with that icon, (displays everywhere it should) so not sure why it was pulled. I can't see any differences between the new and old exccept the "after" file actually has a corrupt image now for the 128x128...

1. Am I supposed to keep the 2 ".txt" files for something?

2. I tried the other script you linked before and it looks like I need to modify it first and/or install more stuff?
-bash: /Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/image2icns: No such file or directory

Thanks
The commands I gave do all the downloading and modifying. One command per line.
The .txt files just list the icons that are inside the icns files (type, offset, size, plus first few bytes).
You don't need to keep the VolumeIcons# folders. They are just there to backup the icons or to make it easier to view or edit them.

Did the one icon that got pulled have a "it32"?

Was there any errors in the output? You can PM me the text output from Terminal.app and the icons folder.
 
The commands I gave do all the downloading and modifying. One command per line.

We're both talking about "https://gist.github.com/joevt/9fa52...malink_comment_id=4006225#gistcomment-4006225", right?
I totally missed your 2nd post after the script post. I'll have to try again.

Did the one icon that got pulled have a "it32"?

I pulled it, but just put it back in to run it. It did convert to "it32", BUT it corrupted that image.

Was there any errors in the output? You can PM me the text output from Terminal.app and the icons folder.

checkiconcompatibility = no errors

image2icns (without instructions) = -bash: /Volumes/Work/Programming/XcodeProjects/Icons/osxiconutils/joevt-osxiconutils/DerivedData/osxiconutils/Build/Products/Debug/image2icns: No such file or directory
 
We're both talking about "https://gist.github.com/joevt/9fa52...malink_comment_id=4006225#gistcomment-4006225", right?
I totally missed your 2nd post after the script post. I'll have to try again.
I am referring to these commands:
Code:
mkdir -p ~/icons
cd ~/icons
git clone https://github.com/joevt/osxiconutils
cd osxiconutils
xcodebuild -alltargets
cd ~/icons
curl -L https://gist.github.com/joevt/6d7a0ede45106345a39bdfa0ac10ffd6/raw -o DiskUtil.sh
curl -L https://gist.github.com/joevt/9fa524ebbef3db46842f14f33cf64ca5/raw -o VolumeIconUtil.sh
perl -i -pE "s|/Volumes.*Debug/|~/icons/osxiconutils/build/Release/|" ~/icons/VolumeIconUtil.sh
source DiskUtil.sh
source VolumeIconUtil.sh
mountEFIpartitions
mountPrebootPartitions
mountRecoveryPartitions
mountRecoveryHDpartitions
checkiconcompatibility
 
In macOS 10.13 High Sierra, it seems that the it32 doesn't get created correctly by icns2icns of osxiconutils (used by checkiconcompatibility).
It works fine for me in Monterey and probably for any other macOS version that existed since when I created the osxiconutils fork.
 
In macOS 10.13 High Sierra, it seems that the it32 doesn't get created correctly...

I hadn't thought about it before. Is it actually High Sierra that runs the option-boot screen? Since a boot disk (OS) hasn't been picked yet, I always assumed it was some other bit of software at that point.
 
I hadn't thought about it before. Is it actually High Sierra that runs the option-boot screen? Since a boot disk (OS) hasn't been picked yet, I always assumed it was some other bit of software at that point.
EFI runs the option-boot screen and loads an icon from the .VolumeIcon.icns file. macOS is used to create the .VolumeIcon.icns file. The icns2icns utility used by the checkiconcompatibility command from VolumeIconUtil.sh doesn't seem to be able to create the it32 icon correctly inside the .VolumeIcon.icns file if the macOS version is High Sierra. It's either a bug in my code or in the macOS code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.