ImageType

ImageType[image]

gives the underlying type of values used for each pixel element in the Image or Image3D object image.

Details

  • Possible types returned by ImageType are:
  • "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 all binary images, ImageType gives "Bit".

Background & Context

  • ImageType gives a label representing the number type used internally to represent each pixel of an image. The Wolfram Language supports images encoded by 1-bit integers (i.e. two-level binary), 8-bit unsigned integers, 16-bit unsigned integers, and 32- and 64-bit real numbers. These different bit depths allow a variety of image encodings, with smaller bit depths used for compact (i.e. lower memory) representation of images and larger bit depths providing higher resolution.
  • Many image processing functions automatically convert integer-type images to a real type for higher accuracy prior to computation.
  • The function Image can be used to convert between image types, and ImageAdjust can be used to bring all values of a real-valued image into the range 0 to 1. Another important property of an image is the number of channels the image contains, which may be obtained using the function ImageChannels.

Examples

Basic Examples  (5)

Byte image:

In[1]:=
Click for copyable input
Out[1]=

A 16-bit grayscale image:

In[1]:=
Click for copyable input
Out[1]=

A real-valued RGB image:

In[1]:=
Click for copyable input
Out[1]=

A binary image:

In[1]:=
Click for copyable input
Out[1]=

A 3D image:

In[1]:=
Click for copyable input
Out[1]=

See Also

BinaryImageQ  ImageData  ImageChannels  Image  ImageDimensions  ImageQ

Tutorials

Introduced in 2008
(7.0)
| Updated in 2012
(9.0)