
im = imread('mona.png');
[N M] = size(im);

out = zeros(N,M);

c = 2.5;
for y=1:N
  for x=2:M
   
    out(y,x) = c * (im(y,x)-im(y,x-1));
    
  end
end

bias = 128;
image(out + bias); colormap(gray(256));