ICO (.ico)

Background

    • Registered MIME type: image/vnd.microsoft.icon
    • Microsoft Windows icon.
    • Raster image file format.
    • Native icon format on Windows.
    • ICO is an acronym derived from icon.
    • Binary format.
    • Can store multiple icons at different color resolutions.
    • Supports alpha channels.
    • Similar to CUR format.

Import & Export

  • Import["file.ico"] imports an ICO file, returning all icons stored in the file as a list of Image objects.
  • Import["file.ico",elem] imports the specified element from an ICO file.
  • The import format can be specified with Import["file","ICO"] or Import["file",{"ICO",elem,}].
  • Export["file.ico",expr] exports an image, graphics, or a list of them to an ICO file.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the ICO file format.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Data"array of color values for each icon
    "GraphicsList"list of graphics objects
    "ImageList"all icons, given as a list of Image objects
    "GrayLevels"array of normalized gray-level values
    "RGBColorArray"array of RGBColor objects for each icon
  • Import by default uses the "ImageList" element for ICO files.
  • Advanced Import elements:
  • "BitDepth"number of bits used to represent each color channel
    "ColorSpace"color encoding used in the file
    "ImageSize"raster dimensions
  • ICO supports a maximum of 256×256 pixels images. Export will scale down Image and Graphics larger than 256 pixels to fit.

Examples

Basic Examples  (3)

Import an ICO file that contains two bitmaps as a list of images:

In[1]:=
Click for copyable input
Out[1]=

Read an ICO file representing an icon at various resolutions:

In[1]:=
Click for copyable input
Out[1]=

Export a list of images at various resolutions to ICO:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2007
(6.0)
|
Updated in 2016
(11.0)