SIVP Toolbox
Last update : July, 2005

imread - Reads image file

Calling Sequence

im = imread(filename)



imread reads many types of image files into Scilab. The format of the file is inferred from the extension in the filename parameter. Currently the following file formats are supported:

* Windows bitmaps - BMP, DIB;
* JPEG files - JPEG, JPG, JPE;
* Portable Network Graphics - PNG;
* Portable image format - PBM, PGM, PPM;
* Sun rasters - SR, RAS;
* TIFF files - TIFF, TIF.
im = imread(filename)
reads image in filename into im matrix. If filename contains a truecolor image, im is a MxNx3 hypermatrix, so for example im(:,:,1) stands for the red channel. For gray images, im is a MxNx1 unsigned char matrix.


    im = imread(SCI + '/contrib/sivp/images/lena.png');

Bugs and Shortcomings

Images with a palette are not supported. All kinds of images are converted to gray images or RGB images.


Shiqi Yu <shiqi.yu[at]>


The latest version of SIVP can be found at

See Also

imwrite,  imshow,  imfinfo,