ICNS (.icns)
Background & Context
-
- 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 & 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 following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - 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.
Examples
open allclose allBasic Examples (3)
Scope (1)
Export automatically scales the image to the closest standard dimension:
Import Elements (15)
Available Elements (3)
Data Representation (5)
Metadata (7)
"ColorSpace" (1)
Get the color encoding used on export:
Use ImageColorSpace to get the color space of an imported image:
"ImageSize" (1)
Get the dimensions of the images stored in the file:
Using ImageDimensions on an imported image gives the same result: