imformats
Lists the image file formats that can be read and written.
Category: Graphics > Images
Syntax
formats = imformats
Returns a struct array describing every known format.
fmt = imformats(ext)
Returns the entry for the file extension ext.
Description
The registry tells imread and imwrite which extensions they understand. Querying it is a quick way to check whether a format such as 'tif' is supported before trying to read a file.
Input arguments
ext- Extension such as
'png'or'jpg'.
Output arguments
formats- Struct array with fields such as
ext,description,readandwrite.
Example
Look up a format
f = imformats('jpg');
disp(f.ext)
Output
{'jpg'} {'jpeg'}