This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# ImageData

 ImageData[image] gives the array of pixel values in image. ImageDatagives the array of pixel values converted to the specified type.
• ImageData[image] by default gives a 2D array whose elements are lists of values for each channel.
• The array generated by ImageData[image] is arranged in the same way that the image is displayed, with the first row corresponding to the top row of pixels in the image.
• For binary images, ImageData[image] returns integer values 0 or 1. For all other images, ImageData[image] returns real values, normally between 0 and 1.
 "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)
• For images of type or , ImageData[image] always normalizes values to lie between 0 and 1. For images of type , ImageData[image] returns whatever real values are used in the image.
• Interleaving returns in the native form used to store the image.
Channel data for the first five pixels of the first row:
Construct a byte-valued image:
Extract normalized raster data:
Extract raw bytes:
Channel data for the first five pixels of the first row:
 Out[1]=

Construct a byte-valued image:
 Out[1]=
Extract normalized raster data:
 Out[2]=
Extract raw bytes:
 Out[3]=
 Options   (3)
By default, data is returned from the top to the bottom:
Reverse the order of rows:
Data of multichannel images is by default returned in interleaved form:
This gives the pixel data in planar form:
Retrieve the image data in interleaved form:
Retrieve the image data in planar form:
ImageData and Raster assume a different ordering of the rows:
To visualize image data using Raster, the rows need to be reversed: