0% found this document useful (0 votes)
13 views2 pages

Sec 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Sec 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

% Image Processing Section (02)

% imfinfo, imwrite, script, function (BrightColor, Bright Gray)


% Getting image information using imfinfo
% information you can find( filename, file mod date(last date modify), filesize, formate,
width, height,
% bitdepth)
%----------------------------------------------------------------
% % converting color image to gray scale image
% % for each pixel the pixel value in gray scale equal to average of RGB
% % layer of color image.
% img = imread('Test1.png');
% imtool(img);
% size(img);
%info=imfinfo('Test1.png') % Getting image information using imfinfo
% % Getting image dimensions using size()
% gray = zeros(200,200,'uint8'); %(unsigned intger 8-bit(uint8 format))
% imtool(gray);
% for i=1:size(img,1)
% for j=1:size(img,2)
% newimage(i,j)=(img(i,j,1)+img(i,j,2)+img(i,j,3))/3;
% end
% end
% imtool(newimage);
%-----------------------------------------------------------------
% % creating Grayscale image with shades of gray
% % Horizontal & Vertical
% A=zeros(256,256,'uint8'); %(unsigned intger 8-bit(uint8 format))
% imtool(A);
% for i=1:256
% for j=1:256
% A(i,j)=j-1;
% end
% end
% imtool(A);
% % % % saving image
% imwrite(A, 'Gray1.png');
%imfinfo 'Gray1.png'
%
% A=zeros(256,256,'uint8');
% for i=1:256
% for j=1:256
% A(i,j)=256-i;
% end
% end
% imtool(A);
%----------------------------------------------------------------
% Creating Grayscale Image with X preview
% X is White/ Background is Black and the inverse
% A=zeros(256,256,'uint8');
% for i=1:256
% for j=1:256
% A(i,j)=255;
% end
% end
% for i=1:256
% A(i,i)=0;
% A(i,257-i)=0;
% end
% imtool(A);
% A=zeros(256,256,'uint8');
% for i=1:256
% A(i,i)=255;
% A(i,257-i)=255;
% end
% imtool(A);
%----------------------------------------------------------------
% creating Color image with shades of Red, Green, Blue
% A=zeros(256,256,3,'uint8');
%
% for i=1:size(A,1)
% for j=1:size(A,2)
% A(i,j,1)=256-j;
% A(i,j,3)=255;
% A(i,j,2)=255;
% end
% end
% imtool(A);
% imwrite(A, 'Color1.png');
% imfinfo 'Color1.png'
%----------------------------------------------------------------

You might also like