Alpha Channel Problems When Creating .ico Files Using ImageMagick

I’ve tried to use ImageMagick to create .ico files for Open Yahtzee, out of PNGs of various sizes. The command as it should have been:

convert openyahtzee16.png openyahtzee32.png openyahtzee64.png openyahtzee.ico

resulted in the alpha channel being reversed. I’ve used ImageMagick 6.4.0, and I didn’t remember this misbehavior happening in the previous versions.

While this annoyed, and was due to no apparent reason, it could be easily solved using the ImageMagick switches to reverse the alpha channel:

-channel Alpha -negate

So the command that produces a correct .ico file was:

convert openyahtzee16.png openyahtzee32.png openyahtzee64.png -channel Alpha -negate openyahtzee.ico

3 thoughts on “Alpha Channel Problems When Creating .ico Files Using ImageMagick

  1. Jeroen Hoek

    Odd. Thanks for posting your solution somewhere for the rest of us to find though, I wouldn’t have figured it out so quickly if you hadn’t.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.