This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert image to movie frame


f = im2frame(X,map)
f = im2frame(X)


f = im2frame(X,map) converts the indexed image, X, and the associated colormap, map, into a movie frame f.

  • If you specify X as an m-by-n array of integers, then im2frame uses the associated colormap, map, where map is a three-column array of values in the range [0,1]. Each row of map is a three-element RGB triplet that specifies the red, green, and blue components of a single color of the colormap.

  • If you specify X as an m-by-n-by-3 truecolor image, then map is optional and has no effect.

f = im2frame(X) converts the indexed image, X, into a movie frame f using the current colormap if X contains an indexed image.

For more information on image types, see Image Types.

Class Support

X must be of class uint8 or double.


Convert Image Sequence to Movie

Use im2frame to convert a sequence of images into a movie.

F(1) = im2frame(X1,map);
F(2) = im2frame(X2,map);
F(n) = im2frame(Xn,map);

See Also


Introduced before R2006a