You are on page 1of 2

EXPERIMENT NO.

-1:
Aim:

Write MATLAB code that will do the following:


(a) Read different images from MATLAB Library. Eg. Gray, Index, Colour, Binary images.
(b) Display size of the images.
(c) Display the images.
(d) Store the images in hard drive using different formats.

Theory: Write brief theory on related topics (How digital image is represented, what is
grayscale, binary, colour and index image)

PROGRAM:
clc;
clear all;
close all;
i1=imread('cameraman.tif');
i2=imread('peppers.png');
i3=imread(peppersbw.tif');
[r1 c1]=size(i1);
[r2 c2]=size(i2);
[r3 c3]=size(i3);
imshow(i1),title('gray image');
figure,imshow(i2),title('colour image');
figure,imshow(i3),title('binary image');
imwrite(i1,'C:\Users\Dell\Desktop\DIP_lab_manual\abc.jpg')
imwrite(i2,'C:\Users\Dell\Desktop\DIP_lab_manual\abcd.tif')
imwrite(i3,'C:\Users\Dell\Desktop\DIP_lab_manual\xyz.jpg')
disp('[r1 c1]:')
disp([r1 c1])
disp('[r2 c2]:')
disp([r2 c2])
disp('[r3 c3]:')
disp([r3 c3])

Results: (Display your own results)

You might also like