clear all;

a=imread('5.bmp');
p=10;
M=[ones(p,p) zeros(p,256-2*p) ones(p,p);zeros(256-2*p,256); ones(p,p) zeros(p,256-2*p) ones(p,p)];
A=M.*fft2(a);
maxA=max(max(A));

orig=uint8(abs(ifft2(A)));
imwrite(orig,'2.bmp','bmp');