Reading Files With 'imread'
The 'imread' function in MATLAB supports a variety of different image file formats as inputs, including but not limited to: '.bmp', '.jpeg', '.png', and '.tiff'. If an image file is not able to be read, please double-check that it is in a file format supported by 'imread', as well as the file is not corrupted or otherwise invalid. For a full list of supported file types, please see the 'imread' documentation:
https://www.mathworks.com/help/matlab/ref/imread.html
Images Appearing Blurry or Stretched
An image may appear stretched or blurry when displayed for a variety of reasons.
- Double-check the resolution and quality of the image file itself, as it may simply be low quality or low resolution on its own.
- If you are using 'imshow' to display an image, please double-check that the 'InitialMagnification' field is set to a value you are expecting. Additionally, saving an image in '.jpeg' format may contribute to some form of Lossy Compression, which will permanently delete image data for the sake of reducing file size. For more information about 'imshow', please see the following documentation page:
- If you are using 'imtool' to display the image file, check if MATLAB is currently in software OpenGL mode. This can be checked by typing the following command into the Command Window: If this outputs something along the lines of:
Version: '1.1.0'
Vendor: 'Microsoft Corporation'
Renderer: 'GDI Generic'
MaxTextureSize: 1024
Visual: 'Visual 0x140, (RGB 24 bits (8 8 8), Z depth ...'
Software: 'true'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {3x1 cell}
MaxFrameBufferSize: 0
then images with a dimension larger than the specified "MaxTextureSize" parameter will appear blurry. To temporarily test if this is the cause, try the following command:
and try displaying the image again to see if the display quality improves.
The above is not an exhaustive list, and if you encounter an issue with a displayed image in MATLAB appearing stretched or blurry, and your case is not one of the above scenarios, please contact MATLAB Support.