Main Content


Read, write, display, and modify images

MATLAB® images are arrays of numeric data on which you can perform analysis. For more information, see Working with Images in MATLAB Graphics.


expand all

imshowDisplay image
imageDisplay image from array
imagescDisplay image with scaled colors
imreadRead image from graphics file
imresizeResize image
imtileCombine multiple image frames into one rectangular tiled image
imwriteWrite image to graphics file
imfinfoInformation about graphics file
imformatsManage image file format registry
cmap2grayConvert RGB colormap to grayscale colormap
frame2imReturn image data associated with movie frame
im2grayConvert RGB image to grayscale
im2frameConvert image to movie frame
im2javaConvert image to Java image
im2doubleConvert image to double precision
ind2rgbConvert indexed image to RGB image
rgb2grayConvert RGB image or colormap to grayscale
rgb2indConvert RGB image to indexed image
getrangefromclassDefault display range of image based on its class
imapproxApproximate indexed image by reducing number of colors
ditherConvert image, increasing apparent color resolution by dithering
cmpermuteRearrange colors in colormap
cmuniqueEliminate duplicate colors in colormap; convert grayscale or truecolor image to indexed image


Image PropertiesImage appearance and behavior


Working with Images in MATLAB Graphics

This section describes different data and image types and gives details about how to read, write, work with, and display graphics images.

Image Types

Types of images supported by MATLAB graphics.

Displaying Image Data

This example shows how to read an RGB image into the workspace and display it.

8-Bit and 16-Bit Images

Reduce memory requirements by storing images as 8-bit or 16-bit unsigned integers.

Read, Write, and Query Image Files

Work with standard image file formats in MATLAB, such as reading and writing image files.

Displaying Graphics Images

Display graphics file images and control the size and aspect ratio.

The Image Object and Its Properties

Like all graphics objects, the image object has a number of properties you can set to fine-tune its appearance on the screen.

Printing Images

Print images in proper proportions by preserving the aspect ratio.

Convert Image Graphic or Data Type

Converting between data types changes the interpretation of the image data.