Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how

Legacy Documentation

Mathematica 8 (2010)

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

ImageData

ImageData [image]
gives the array of pixel values in image.
ImageData
gives 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.
(2)
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]=
(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:
(2)
ImageData and Raster assume a different ordering of the rows:
To visualize image data using Raster , the rows need to be reversed:
New in 7 | Last modified in 8


ja zh

AltStyle によって変換されたページ (->オリジナル) /