isgray

Returns true if the given image, x, is grayscale.

Syntax

R = isgray(x)

Inputs

x
Name of the image file, 2D or ND non-sparse matrix.
Type: string | mat

Outputs

R
Returns true if x is grayscale and false otherwise.
Type: logical

Examples

Checks if an image file is grayscale:
R = isgray('test.bmp')
R = 1