difference between "imread" and "load" an image

18 views (last 30 days)
Hello,
I'm a new user to matlab image processing toolbox. I also work on Wavelet toolbox and I noticed that: in the image toolbox "imread" is used more often and in wavelet toolbox "load" is used rather than "imread".
so I would like to know the difference between the both commands and when to use each.
thank you in advance.

Accepted Answer

David Young
David Young on 1 Sep 2011
Images can be saved as files on disk in a variety of formats. The formats are often known by their filename extensions, such as .jpg.
Many of these formats can be read and written by a variety of programs, and are not specific to MATLAB. These include .jpg, .bmp, .tiff, .dicom and many other file types. To read such files you use imread (and to write them you use imwrite). The documentation tells you what file formats imread can deal with.
One format is specific to MATLAB: this is the .mat format. This can be used to save any kind of data, including arrays that represent images. To read .mat files you use load (and to write them you use save).
For further information, you will find the table in "Supported File Formats" helpful.
If you simply have a file you need to read, your choice of load or imread is simple: it just depends on the given file's format. However, if you want to create image files and read them later, it's more complex. In this case you need to choose a format, and this will depend on whether you want the image to be readable by other programs, whether you want to compress the image, what other information you want to store with the image, and maybe other factors.

More Answers (0)

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!