Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to create .ico file in Mathematica? I mean the favicon images used for web sites. Directly using Export["file.ico", <some graphical expression>] does not seem to work.

share|improve this question
If you have imagemagic installed on mac or linux(windows I believe supports this also) I would do convert favicon.ico favicon.png Surely you could easily couple this with an png export. – Liam Mar 26 '14 at 0:52
If this is a one time thing I agree with Liam, and the is awash with alternative solutions. – C. E. Mar 26 '14 at 1:24
What version of Mathematica are you on, and what OS? I'm guessing version 8, right? – Jens Mar 26 '14 at 1:56
@Problemaniak Have a look also here: ´…; – Alexei Boulbitch Mar 26 '14 at 9:06
up vote 4 down vote accepted

Exporting .ico from Mathematica works fine in version 9.0.1. On Mac, the built-in function sips tells me that it only supports image sizes that are a power of 2. So you could try to create the desired file using this:

Export["img.ico", img, ImageSize -> {256, 256}]

where img is the image to be exported. However, in version 9.0.1 I'm able to export arbitrarily sized images to .ico as well.

share|improve this answer
As for the ImageSize, the documentation says:"ICO supports a maximum of 256*256 pixels images. Export will scale down Image and Graphics larger than 256 pixels to fit." – sunt05 Mar 26 '14 at 4:30
So, ImageSize -> {256, 256} in Jens' program above is not necessary, right? – qazwsx Mar 26 '14 at 5:53
I just did an experiment which seems to confirm that ImageSize -> {256, 256} is not necessary, at least for Mathematica 9.0.1 in Mac. – qazwsx Mar 26 '14 at 5:56
@Problemaniac It's not necessary, but I threw it in as a guess because I don't know for sure why the OP is having trouble. Maybe the answer boils down to: upgrade to version 9.0.1. – Jens Mar 26 '14 at 5:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.