%SATURATION
I=imread('im1.jpg');
hsv=rgb2hsv(I);
hsv(:,:,2)=hsv(:,:,2)+hsv(:,:,2)*3;
hsv(:,:,3)=hsv(:,:,3)+hsv(:,:,3)*1;
rgb=hsv2rgb(hsv);
%figure,imshow(rgb)
figure,imshow(log(rgb))
% red 0°, green  120° and  blue 240°,  red at 360°
%HUE
im=uint8(ones(512,512,3)*255);
mask=zeros(512,512)==1;
mask(128+64:256+64,128+64:256+64,:)=1;
r=im(:,:,1);
g=im(:,:,2);
b=im(:,:,3);
im(mask)=0;
%figure,imshow(im);
hsv=rgb2hsv(im);
h=hsv(:,:,1);
s=hsv(:,:,2);
v=hsv(:,:,3);
h(mask)=240/360;
hsv(:,:,1)=h;

rgb=hsv2rgb(hsv);
figure,imshow(rgb)



I=imread('Lenna.png');
figure,imshow(I)
gray=rgb2gray(I);
figure,imshow(gray)
imhist(gray)
m=mean(double(gray(:)))
zero_meanIm=double(gray)-m;
J=zero_meanIm+100; % We are changing mean gray value with 100
figure, imshow(J)
figure,imhist(J)
figure,imhist(uint8(J))
figure,imhist(uint8(gray))

%contrast scretching
minIm=min(gray(:))
maxIm=max(gray(:))
K=(gray-minIm)*(255/(maxIm-minIm));
figure,imhist(K)
max(K(:))
figure, imshow(K)
figure, imshow(K+100)
figure, imshow(K-100)
figure,imhist(K-50)
