-
See Also
- Image
- Image3D
- ImageValue
- PixelValue
- ReplacePixelValue
- ImageDimensions
- ImageChannels
- ImageType
- ImageQ
- Transpose
-
- Interpreter Types
- Image
- Related Guides
- Tech Notes
ImageData
Details and Options
- ImageData[image] by default gives a 2D or 3D array whose elements are lists of values for each channel. For a single-channel image, only a value and not a list of values is returned.
- In 2D, 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.
- In 3D, the array generated by ImageData[image] is arranged such that the first part corresponds to the top slice, with rows running from back to front, and columns running from left to right.
- For binary images, ImageData[image] returns integer values 0 or 1. For images of type "Byte" or "Bit16", ImageData[image] always normalizes values to lie between 0 and 1. For images of a real type, ImageData[image] returns whatever real values are used in the image.
- Possible types specified in ImageData[image,"type"] are:
-
"Bit" integer 0 or 1 "Byte" integer 0 through 255 "Bit16" integer 0 through 65535 "Real32" single-precision real (32-bit) "Real64" double-precision real (64-bit) - ImageData[image,Automatic] is equivalent to ImageData[image,ImageType[image]].
- The following options can be given:
-
DataReversed False the order of the rows returned Interleaving True whether to return interleaved or planar data - Interleaving->Automatic returns in the native form used to store the image.
Examples
open all close allBasic Examples (3)
Channel data for the first five pixels of the first row:
ImageData[[image]][[1, 1 ;; 5]]Construct a byte-valued image:
i = Image[ {{0, 63, 127, 191, 255}, {0, 50, 100, 150, 200}}, "Byte"]Extract normalized raster data:
ImageData[i]ImageData[i, "Byte"]ImageData[[image]]//MatrixFormOptions (3)
DataReversed (1)
Interleaving (2)
Data of multichannel images is by default returned in interleaved form:
ImageData[[image]]//DimensionsThis gives the pixel data in planar form:
ImageData[[image], Interleaving -> False]//DimensionsRetrieve the image data in interleaved form:
i = Image[RandomInteger[255, {4, 4, 3}], "Byte"]MatrixForm@ImageData[i, Automatic, Interleaving -> True]Retrieve the image data in planar form:
MatrixForm /@ ImageData[i, Automatic, Interleaving -> False]See Also
Image Image3D ImageValue PixelValue ReplacePixelValue ImageDimensions ImageChannels ImageType ImageQ Transpose
Interpreter Types: Image
Function Repository: ExtractPlotImageData
Tech Notes
Text
Wolfram Research (2008), ImageData, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageData.html (updated 2012).
CMS
Wolfram Language. 2008. "ImageData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageData.html.
APA
Wolfram Language. (2008). ImageData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageData.html
BibTeX
@misc{reference.wolfram_2026_imagedata, author="Wolfram Research", title="{ImageData}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageData.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_imagedata, organization={Wolfram Research}, title={ImageData}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageData.html}, note=[Accessed: 13-June-2026]}