MATLAB: Do IMAGE and IMSHOW display the grayscale image differently in MATLAB 7.11 (R2010b)

MATLAB

I have a grayscale input image which is perfectly displayed by the IMSHOW function. However when I try to use the IMAGE function to display the same, it does not show the exact same pixel values as shown by the IMSHOW function.

Best Answer

The IMAGE function is intended to be used with indexed images and true color images. For more information, please refer to the documentation for acceptable file types for the IMAGE function.
Even if provided with a grayscale input, the IMAGE function treats it as indexed images with the default color map. Therefore it truncates the input values to get an integer. On the other hand, the IMSHOW function by default treats the input as grayscale image.
Related Question