| MATLAB® | ![]() |
imformats
formats = imformats
formats = imformats('fmt')
formats = imformats(format_struct)
formats = imformats('factory')
imformats displays a table of information listing all the values in the MATLAB file format registry. This registry determines which file formats are supported by the imfinfo, imread, and imwrite functions.
formats = imformats returns a structure containing all the values in the MATLAB file format registry. The following tables lists the fields in the order they appear in the structure.
Field | Value |
|---|---|
A cell array of strings that specify filename extensions that are valid for this format | |
A string specifying the name of the function that determines if a file is a certain format. This can also be a function handle. | |
A string specifying the name of the function that reads information about a file. This can also be a function handle. | |
A string specifying the name of the function that reads image data in a file. This can also be a function handle. | |
A string specifying the name of the function that writes MATLAB data to a file. This can also be a function handle. | |
Returns 1 if the format has an alpha channel, 0 otherwise | |
A text description of the file format |
Note The values for the isa, info, read, and write fields must be functions on the MATLAB search path or function handles. |
formats = imformats('fmt') searches the known formats in the MATLAB file format registry for the format associated with the filename extension 'fmt'. If found, imformats returns a structure containing the characteristics and function names associated with the format. Otherwise, it returns an empty structure.
formats = imformats(format_struct) sets the MATLAB file format registry to the values in format_struct. The output structure, formats, contains the new registry settings.
Caution Using imformats to specify values in the MATLAB file format registry can result in the inability to load any image files. To return the file format registry to a working state, use imformats with the 'factory' setting. |
formats = imformats('factory') resets the MATLAB file format registry to the default format registry values. This removes any user-specified settings.
Changes to the format registry do not persist between MATLAB sessions. To have a format always available when you start MATLAB, add the appropriate imformats command to the MATLAB startup file, startup.m, located in $MATLAB/toolbox/local on UNIX systems, or $MATLAB\toolbox\local on Windows systems.
formats = imformats;
formats(1)
ans =
ext: {'bmp'}
isa: @isbmp
info: @imbmpinfo
read: @readbmp
write: @writebmp
alpha: 0
description: 'Windows Bitmap (BMP)'fileformats, imfinfo, imread, imwrite, path
Bit-Mapped Images for related functions
![]() | imfinfo | import | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |