This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Image

Image[data]
represents a raster image with pixel values given by the array data.
Image[graphics]
creates a raster image from a graphics object.
Image
gives an image that uses the specified options.
  • Image[...] displays in a notebook as an image.
  • Image[data] arranges successive rows of data down the page, and successive columns across.
  • In Image[data], each element of data can specify values for any number of channels.
  • By default, elements of data are displayed as follows:
vgray level from 0 (black) to 1 (white)
{r,g,b}red, green, blue values from 0 to 1
{c1,c2,c3,...}channel values represented by equally spaced hues
  • Image[data] by default allows values of any size, but displays only values between 0 and 1.
  • Image takes values of the following types:
"Bit"integer 0 or 1
"Byte"integer 0 through 255
"Bit16"integer 0 through 65535
"Real32"single precision real (32-bit)
"Real"double precision real (64-bit)
  • Image coerces values in data to the specified type by rounding or clipping.
  • Image can be used to convert between types.
  • Image takes the following options:
ColorSpaceAutomaticwhat color space to assume for the data
ImageResolutionAutomaticthe resolution to use when exporting
ImageSizeAutomaticthe default displayed size of the image
InterleavingAutomaticwhether to assume channels are interleaved
MagnificationAutomatichow to magnify the displayed image
TaggingRules{}tagging rules associated with the image
  • ColorSpace specifies that values in the data should be interpreted as coordinates in a particular color space. ColorSpace->Automatic treats values as arbitrary channel intensities.
  • With the setting ColorSpace, data given as is taken to include an opacity value a.
  • With the default setting Interleaving->True, Image takes data to be a 2D array of lists of channel values.
  • Explicit settings for ImageSize determine the absolute size at which images should be displayed.
  • A setting Magnification->m specifies that each pixel in Image[...] should be displayed as an m×m block of pixels.
  • With Magnification->Automatic, smaller images are typically displayed at larger magnifications, and large images are reduced to fit within available notebook or other display areas.
  • Image effectively resets the options for an image.
Create an image object from a 3×3 array:
Create a real-value image from random numbers in the range 0 to 1:
Image with three color channels:
Image created from random bytes in the range 0 to 255:
Binary image from cellular automaton data:
Import an image from a file:
Change the image type:
Create an image object from a 3×3 array:
In[1]:=
Click for copyable input
Out[1]=
 
Create a real-value image from random numbers in the range 0 to 1:
In[1]:=
Click for copyable input
Out[1]=
 
Image with three color channels:
In[1]:=
Click for copyable input
Out[1]=
 
Image created from random bytes in the range 0 to 255:
In[1]:=
Click for copyable input
Out[1]=
 
Binary image from cellular automaton data:
In[1]:=
Click for copyable input
Out[1]=
 
Import an image from a file:
In[1]:=
Click for copyable input
Out[1]=
Change the image type:
In[2]:=
Click for copyable input
Out[2]=
Change the image type from 8-bit to 64-bit:
Random RGB color image:
Random RGB image with alpha channel:
A random gray-level image:
Random gray-level image with alpha channel:
Image with an explicit setting for the width:
Setting the displayed size of an image:
Mathematica by default assumes that color channels are represented in interleaved form:
Image with data stored in three color planes:
Converting to an image type with smaller bit depth can be used for compression:
Convert a binary image to array rules:
Create a binary image from sparse data:
New in 7 | Last modified in 8