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.
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 Apples 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).