Skip to Main Content Skip to Search
Product Documentation

imformats - Manage image file format registry

Syntax

imformats
formats = imformats
formats = imformats('fmt')
formats = imformats(format_struct)
formats = imformats('factory')

Description

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

ext

A cell array of strings that specify filename extensions that are valid for this format

isa

A string specifying the name of the function that determines if a file is a certain format. This can also be a function handle.

info

A string specifying the name of the function that reads information about a file. This can also be a function handle.

read

A string specifying the name of the function that reads image data in a file. This can also be a function handle.

write

A string specifying the name of the function that writes MATLAB data to a file. This can also be a function handle.

alpha

Returns 1 if the format has an alpha channel, 0 otherwise

description

A text description of the file format

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.

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.

Examples

formats = imformats;
formats(1)

ans = 

            ext: {'bmp'}
            isa: @isbmp
           info: @imbmpinfo
           read: @readbmp
          write: @writebmp
          alpha: 0
    description: 'Windows Bitmap (BMP)'

See Also

imfinfo | imread | imwrite | path

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS