function [] = basicImage(sampleImage)

% Images are just matrices of numbers. Let's make a blank white image.
% Grayscale images are scaled from 0.0 to 1.0, with 0.0 black.
image = ones(500, 500);

% There are two different image display methods. imshow() operates on
% matrices of type uint_8 (0 to 255), or type double (0 to 1.0).
figure;
imshow(image); % Display the white image
title('Our blank image');

% Image files can be read with imread(). Here we read a sample in PNG format
% to get a RGB (N X M X 3) matrix, where the 3rd dimensions are the RGB
% channels, respectively
sample_rgb = imread(sampleImage);
fprintf('Loaded Sample as a %d by %d by %d matrix.\n', ...
    size(sample_rgb,1), size(sample_rgb,2), size(sample_rgb,3));
figure;
imshow(sample_rgb);
title('RGB Sample');

% Convert the RGB matrix to grayscale, with values 0 to 255
% Note: imread and rgb2gray return matrices of uint_8
% Calling double() converts these to doubles, which are easier to use
sample_gray = double(rgb2gray(sample_rgb));

% imagesc() shows any 2D matrix as a colorized image. You can also
% normalize the image to be on the range (0, 1.0) and use imshow()
figure;
imagesc(sample_gray);
colorbar;
title('Sample with imagesc()');

sample_gray = sample_gray/255;
figure;
imshow(sample_gray);
title('Normalized Waldo with imshow()');

% Since images are just matrices, we can paste this sample into the image by
% assigning it to a block. Note that matrices are indexed (y,x) with (1,1) at
% the upper left hand corner. This is the same convention as for images.
H = size(sample_gray, 1); W = size(sample_gray, 2); % Get his height and width
image(10:10+H-1, 20:20+W-1) = sample_gray;
figure;
imshow(image);
title('Our blank image with the sample  pasted in.');

% Note that we pasted the sample in so that his upper left corner is at (20, 10)
% in x-y coordinates or (10, 20) in row, column coordinates.

end
