a=imread('spongebob2.jpg');
figure, imshow(a);
r=a(:,:,1);
g=a(:,:,2);
b=a(:,:,3);
b1=(r+g+b)/3;
c=(0.65*r)+(0.33*g)+(0.02*b);
d=rgb2gray(a);
figure,imshow(b1);
figure,imhist(b1);
figure,imshow(c);
figure,imhist(c);
figure,imshow(d);
figure, imshow(a);
r=a(:,:,1);
g=a(:,:,2);
b=a(:,:,3);
b1=(r+g+b)/3;
c=(0.65*r)+(0.33*g)+(0.02*b);
d=rgb2gray(a);
figure,imshow(b1);
figure,imhist(b1);
figure,imshow(c);
figure,imhist(c);
figure,imshow(d);