Export Picture to .ico (X-Platform)

I can on a one by one exception I can use Preview on Mac OS to export an image as a .ico file.

But I prefer to be able to export it from my application.

Hint is (are ?) welcome.


PS: from the Picture entry in the LR:

[code]The valid formats are:


Isn’t an ICO file just a limited resolution PNG file with a .ico extension?

Save the picture as a 32x32 PNG.


That is not what I saw on Microsoft web site; they were talking about multi sized Icons (squared 16, 32, 48 and 256; more size are desirable…).

But I will do that.

Edit: @ 96 dpi I suppose.

An ICO file originally was kinda like an extended bmp file that allowed for multi-sized images. Nowadays ICO files can contain not only bmp data, but also PNG.

Apple’s ImageIO library only supports the BMP variations, and only a handful of icon sizes, and that’s for the macOS only.

So you may need to create your own, the ICO format is fairly well documented and would be a good lesson in learning how to process files at a byte level.

There’s already a class for this available from the following link.


Thank you Sam.

Nota: Preview, the Mac OS application can export an image (with a png tag at the start of the image file, at 256 x 256 no more higher size) as an .ico file.

Exporting the file as png fail at the set a custom icon to a folder item on Windows 10 1803 (vs the one Apple’s Preview Generated).

Windows says: (translated from French, so the words can be different, not the error): “The file d:\<file_name.ico contains no icon.”.

My first quest (search on the internet) does not lead to anything special, people says what David say: save the image as png and change the .ico. Usually, when someone (a WIndows user) told me to change the file Extension to get a specific file, I am sceptikal (or negative), but since I already read that answer on the net… I tried it.

.bmp files looks like some Apple IIgs (someone recall this machine ?) image file format, so I am in a know area. I only need the file format. The quest will resume in around two hours (with a faster internet connection).

Thank you all.