ICNS (.icns)


    Macintosh icons format.
    Raster image file format.
    ICNS is an acronym derived from icon.
    Binary format.
    Can store multiple icons at different color resolutions.
    Supports alpha channels.

Import and Export

  • Import["file.icns"] imports an ICNS file, returning all icons stored in the file as a list of Image objects.
  • Import["file.icns",elem] imports the specified element from an ICNS file.
  • The import format can be specified with Import["file","ICNS"] or Import["file",{"ICNS",elem,}].
  • Export["file.icns",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 ICNS format.


  • 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
  • Import by default uses the "ImageList" element for ICNS files.
  • Advanced Import elements:
  • "BitDepth"number of bits used to represent each color channel
    "Channels"the number of color channels used in the file
    "ColorSpace"color encoding used in the file
    "ImageCount"number of frames in ICNS
    "ImageSize"raster dimensions
    "Summary"summary of the file
    "SummarySlideView"slide-view summary of all frames
  • Export accepts Image and Graphics of dimensions 512×512, 256×256, 128×128, 48×48, 32×32, and 16×16. An image or graphics object not at one of the standard dimensions will be scaled so that its longest dimension fits the closest standard dimension.


open allclose all

Basic Examples  (3)

Read an ICNS file representing an icon at various resolutions:

Click for copyable input

Summary of an image:

Click for copyable input

Summary slide view for a multiframe ICNS file:

Click for copyable input

Export a list of images at various resolutions to ICNS:

Click for copyable input

Scope  (1)

Import Elements  (15)

See Also

"ICO"  "BMP"  "PNG"

Introduced in 2012
| Updated in 2016