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

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[obj, options]
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[data, "type"] takes values of the following types:
"Bit"integer 0 or 1
"Byte"integer 0 through 255
"Bit16"integer 0 through 65535
"Real"machine real
  • Image[data, "type"] coerces values in data to the specified type by rounding or clipping.
  • 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->"space" 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->"RGB", data given as {r, g, b, a} is taken to include an opacity value a.
  • With the default setting Interleaving->True, Image[data, ...] takes data to be a 2D array of lists {c1, c2, ...} of channel values.
  • With Interleaving->False, Image[data, ...] takes data to be a list {p1, p2, ...} of 2D arrays of values for each channel.
  • 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[graphics] effectively uses Rasterize[graphics, "Image"] to rasterize graphics.
  • Image[Image[...], opts] 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:
Random RGB color image:
Random RGB image with alpha channel:
A random graylevel image:
Random graylevel 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:
New in 7