% -----------------------------------------------------
% readimages.m
% -----------------------------------------------------
% Write a program that reads and displays two images - one
% true color (jpg) and the other indexed color map (bmp). 
% -----------------------------------------------------
% Notes: An image is a 2D sheet on which the color at 
% any point can have essentially infinite variability. 
%
% We can represent any given image as a 2D array of points - 
% pixels or picture elements, each of which is 'painted' by 
% blending variable amounts of the three primary colors -
% red, green and blue
%
% The image files used must be in the same folder as the 
% program. 
% -----------------------------------------------------
% Copyright and license details available at matlabmarina.com
%------------------------------------------------------

clear;
clc;
close all;

% True color 
% JPEG images
[image1,map1] = imread('Armstrong.jpg');

figure(1)
image(image1);
axis off;

% Color mapped images
% GIF and BMP files
[image2,map2] = imread('L1011.bmp');

figure(2)
image(image2);
colormap(map2);

% Changing colormaps 
figure(3)
image(image2);
colormap(map2);
colormap bone;
