Image color data, specified in one of these forms:

Vector or matrix — This format defines indexed
image data. Each element of `C`

defines a color for
1 pixel of the image. For example, ```
C = [1 2 3; 4 5 6; 7 8
9];
```

. The elements of `C`

map to colors
in the colormap. The `CDataMapping`

property controls
the mapping method.

3-D array of RGB triplets — This format defines
true color image data using RGB triplet values. Each RGB triplet defines
a color for 1 pixel of the image. An RGB triplet is a three-element
vector that specifies the intensities of the red, green, and blue
components of the color. The first page of the 3-D array contains
the red components, the second page contains the green components,
and the third page contains the blue components. Since the image uses
true colors instead of colormap colors, the `CDataMapping`

property
has no effect.

If `C`

is of type `double`

,
then an RGB triplet value of `[0 0 0]`

corresponds
to black and `[1 1 1]`

corresponds to white.

If `C`

is an integer type, then the
image uses the full range of data to determine the color. For example,
if `C`

is of type `uint8`

, then ```
[0
0 0]
```

corresponds to black and `[255 255 255]`

corresponds
to white. If `CData`

is of type `int8`

,
then `[-128 -128 -128]`

corresponds to black and ```
[127
127 127]
```

corresponds to white.

If `C`

is of type `logical`

,
then `[0 0 0]`

corresponds to black and ```
[1
1 1]
```

corresponds to white.

This illustration shows the relative dimensions of `C`

for
the two color models.

The behavior of `NaN`

elements is not defined.

To use the low-level version of the `image`

function
instead, set the `CData`

property as a name-value pair.
For example, `image('CData',C)`

.

#### Converting Between Data Types

To convert indexed image data from an integer type to type `double`

,
add 1. For example, if `X8`

is indexed image data
of type `uint8`

, convert it to type `double`

using:

To convert indexed image data from type `double`

to
an integer type, subtract 1 and use `round`

to ensure
that all the values are integers. For example, if `X64`

is
indexed image data of type `double`

, convert it to `uint8`

using:

To convert true color image data from an integer type to type `double`

,
rescale the data. For example, if `RGB8`

is true
color image data of type `uint8`

, convert it to `double`

using:

To convert true color image data from type `double`

to
an integer type, rescale the data and use `round`

to
ensure that all the values are integers. For example, if `RGB64`

is
image data of type `double`

, convert it to `uint8`

using:

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

Placement along the *x*-axis, specified in
one of these forms:

Two-element vector — Use the first element
as the location for the center of `C(1,1)`

and the
second element as the location for the center of `C(m,n)`

,
where `[m,n] = size(C)`

. If `C`

is
a 3-D array, then `m`

and `n`

are
the first two dimensions. Evenly distribute the centers of the remaining
elements of `C`

between those two points.

The width of each pixel is determined by the expression:

If `x(1)`

> `x(2)`

, then
the image is flipped left-right.

Scalar — Center `C(1,1)`

at
this location and each following element one unit apart.

To use the low-level version of the `image`

function
instead, set the `XData`

property as a name-value pair.
For example, `image('XData',x,'YData',y,'CData',C)`

.

You cannot interactively pan or zoom outside the x-axis limits
or y-axis limits of an image, unless the limits are already set outside
the bounds of the image. If the limits are already outside the bounds,
there is no such restriction. If other objects (such as a line) occupy
the axes and extend beyond the bounds of the image, you can pan or
zoom to the bounds of the other objects, but no further.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

Placement along *y*-axis, specified in one
of these forms:

Two-element vector — Use the first element
as the location for the center of `C(1,1)`

and the
second element as the location for the center of `C(m,n)`

,
where `[m,n] = size(C)`

. If `C`

is
a 3-D array, then `m`

and `n`

are
the first two dimensions. Evenly distribute the centers of the remaining
elements of `C`

between those two points.

The height of each pixel is determined by the expression:

If `y(1)`

> `y(2)`

, then
the image is flipped up-down.

Scalar — Center `C(1,1)`

at
this location and each following element one unit apart.

To use the low-level version of the `image`

function
instead, set the `YData`

property as a name-value pair.
For example, `image('XData',x,'YData',y,'CData',C)`

.

You cannot interactively pan or zoom outside the x-axis limits
or y-axis limits of an image, unless the limits are already set outside
the bounds of the image. If the limits are already outside the bounds,
there is no such restriction. If other objects (such as a line) occupy
the axes and extend beyond the bounds of the image, you can pan or
zoom to the bounds of the other objects, but no further.

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

Specify optional comma-separated pairs of `Name,Value`

arguments.
`Name`

is the argument
name and `Value`

is the corresponding
value. `Name`

must appear
inside single quotes (`' '`

).
You can specify several name and value pair
arguments in any order as `Name1,Value1,...,NameN,ValueN`

.

**Example: **`image([1 2 3],'AlphaData',0.5)`

displays
a semitransparent image.The properties listed here are a subset of image properties.
For a complete list, see Image Properties.

Color data mapping method, specified as `'direct'`

or `'scaled'`

.
Use this property to control the mapping of color data values in `CData`

into
the colormap. `CData`

must be a vector or a matrix
defining indexed colors. This property has no effect if `CData`

is
a 3-D array defining true colors.

The methods have these effects:

`'direct'`

— Interpret the
values as indices into the current colormap. Values with a decimal
portion are fixed to the nearest lower integer.

If the values are of type `double`

or `single`

,
then values of `1`

or less map to the first color
in the colormap. Values equal to or greater than the length of the
colormap map to the last color in the colormap.

If the values are of type `uint8`

, `uint16`

, `uint32`

, `uint64`

, `int8`

, `int16`

, `int32`

,
or `int64`

, then values of `0`

or
less map to the first color in the colormap. Values equal to or greater
than the length of the colormap map to the last color in the colormap
(or up to the range limits of the type).

If the values are of type `logical`

,
then values of `0`

map to the first color in the
colormap and values of `1`

map to the second color
in the colormap.

`'scaled'`

— Scale the values
to range between the minimum and maximum color limits. The `CLim`

property
of the axes contains the color limits.

Transparency data, specified in one of these forms:

The `AlphaDataMapping`

property controls
how the transparency data values are interpreted.

**Example: **`0.5`

**Data Types: **`single`

| `double`

| `int8`

| `int16`

| `int32`

| `int64`

| `uint8`

| `uint16`

| `uint32`

| `uint64`

| `logical`

Transparency data mapping method, specified as `'none'`

, `'scaled'`

,
or `'direct'`

. Use this property to control how the
transparency values in `AlphaData`

are interpreted.

The methods have these effects:

`'none'`

— Clamp the values
to the region between 0 and 1. A value of 1 or greater is completely
opaque, a value of 0 or less is completely transparent, and a value
between 0 and 1 is semitransparent.

`'scaled'`

— Scale the values
to range between the minimum and maximum alpha limits of the axes.
The `ALim`

property
of the axes contains the alpha limits.

`'direct'`

— Interpret the
values as indices into the figure alphamap. The `Alphamap`

property
of the figure contains the alphamap. Values with a decimal portion
are fixed to the nearest lower integer.

If the values are of type `double`

or `single`

,
then values of 1 or less map to the first element in the alphamap.
Values equal to or greater than the length of the alphamap are mapped
to the last element in the alphamap.

If the values are of type `uint8`

, `uint16`

, `uint32`

, `uint64`

, `int8`

, `int16`

, `int32`

,
or `int64`

then values of 0 or less map to the first
element in the alphamap. Values equal to or greater than the length
of the alphamap are mapped to the last element in the alphamap (or
up to the range limits of the type).

If the values are of type `logical`

,
then values of 0 map to the first element in the alphamap and values
of 1 map to the second element in the alphamap.