%f=zeros(31,31);
%f(10:20,10:20)=1;

f= imread('C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg');
f = im2double(f);

F=fft2(f);

S=abs(F);
%imshow(f)
%imshow(S,[])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fc=fftshift(f);
Sc=abs(Fc);
%imshow(Sc,[])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%F2 = log(1+double(Sc));
 %c = 1/log(1+1);
 
f = f*2^10;
c = 1/log(1+2^10);
 
F2 = c*log(1 + double(f));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

f=real(ifft2(F));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

subplot(1,4,1);imshow(S,[]);
subplot(1,4,2);imshow(Sc,[]);
subplot(1,4,3);imshow(F2,[]);
subplot(1,4,4);imshow(f,[]);

