function z = zc(a);
%  z = zc(a);
[m, n] = size(a);
z = setconst(a,255);
for ii = 2:m-1
  for jj = 2:n-1
    aij = a(ii,jj);
    if aij == 0 
      z(ii,jj) = 0;
    end
%    if aij*a(ii-1,jj-1) < 0 
%      z(ii,jj) = 255;
%    end
    if aij*a(ii-1,jj) < 0 
      z(ii,jj) = 0;
    end
%    if aij*a(ii-1,jj+1) < 0 
%      z(ii,jj) = 255;
%    end
    if aij*a(ii,jj-1) < 0 
      z(ii,jj) = 0;
    end
    if aij*a(ii,jj+1) < 0 
      z(ii,jj) = 0;
    end
%    if aij*a(ii+1,jj-1) < 0 
%      z(ii,jj) = 255;
%    end
    if aij*a(ii+1,jj) < 0 
      z(ii,jj) = 0;
    end
%    if aij*a(ii+1,jj+1) < 0 
%      z(ii,jj) = 255;
%    end
  end
end
