%% Convert Truecolor (RGB) Image to Grayscale Image Using im2gray
% Read a truecolor (RGB) image into the workspace from a file and display it.

RGB = imread('example.tif');
figure;
imshow(RGB);

% Convert the RGB image into a grayscale image.

I = im2gray(RGB);

% Display the converted grayscale image.

figure;
imshow(I);

% Copyright 2020 The MathWorks, Inc.