% Code By Swayam Pattanayak
%To make a Movie converting Truecolor image to Intensity image ...
%and finally showing with colorbar
x10=imread('br.jpg');
dxz=double(x10);
yz=uint8(dxz);
gyz=(dxz(:,:,1)+dxz(:,:,2)+dxz(:,:,3))/3; % convert tointensity level by averaging Operation
gyz1=gyz;
movv=moviein(50);% create movie frame
 for i=1:20
gyz=(dxz(:,:,1)+dxz(:,:,2)+dxz(:,:,3))/i;
yz(:,:,1)=gyz;
yz(:,:,2)=gyz;
yz(:,:,3)=gyz;
imshow(yz,[]);
movv(:,i)=getframe;% record movie
 end;
movie(movv,3); % play movie
pause(0.333);
imshow(gyz1,[]),colorbar;
%figure,imshow(x1),colorbar;
figure,imshow(yz);
disp('Howz the 2nd movie Dr Lakaemper!!')