% Loading and Viewing an Image Exercise

im_info = imfinfo('trees.tif');
im_info(1).ColorType

[I,map] = imread('trees.tif');
subplot(2,2,1.5)
subimage(I,map)

I_gray = ind2gray(I,map);
subplot(2,2,3)
subimage(I_gray)

I_bw = im2bw(I,map,0.4);
subplot(2,2,4)
subimage(I_bw)

% Easter egg
figure
[I2,map] = imread('trees.tif',2);
imshow(I2,map)