I have several Mac apps already created using another tool that I need to create Apple images for. They were created as PNG files without an alpha channel and stored in a folder.
I attempted to do the following command:
iconutil -c icons myfolder.iconset
I got multiple errors like below:
iconutil error: Unsuported image format
After reading this blog post along with a couple of posts on Stack Overflow I saw that I needed to have an alpha channel on my images. This is not stated in the Apple Developer documentation.
I tried using Preview for this but from the research I have done, including watching several videos I would have to remove a color which would mess up my icons, especially the smaller ones. My icons have a black background and attempting to remove what little white is on them would be a nightmare for the smaller icons.
There is a comment on this link by David Grayson that stated that ImageMagick could be used to add the alpha channel. The comment said that if I executed the following command for each png file that should work.
convert old_icon_16x16.png -define png:color-type=6 icon_16x16.png
However when I execute this I get the following error:
Abort trap: 6
I then went to this link referenced by the main ImageMagick website for examples. I tried the following command.
convert old_icon_16x16.png -alpha off -alpha on icon_16x16.png
I got the following error:
Abort trap: 6
I'm not sure where to go from here.
If you are getting
Abort
orSegmentation Faults
, it smacks of a mismatch in the compiling/building/linking of your ImageMagick.I would suggest you remove whatever you have installed of ImageMagick, and start afresh with
homebrew
which is the simplest way of installing ImageMagick on OSX. Basically, you go to the Homebrew website and copy and paste the one-liner into Terminal to install it (I don't want to show the line here in case it changes in future and this gets out of date).Once you have homebrew installed, it is just a matter of:
If, you want to see the options for supporting X11, TIFF, fftw etc, just run:
Output
Then you can either do:
or, if you have already installed ImageMagick, you can change your installed options with:
As Glenn points out in the comments, an easier command than the one you are using is probably:
Also, note that
convert
becomesmagick
from Version 7 onwards - thoughhomebrew
is still delivering Version 6 at the moment.