Rich (BB code):

```
clear ;
imagergb = imread('Block.jpg');
imagegray = rgb2gray(imagergb);
size = size(imagegray);
row = size(1);
column = size(2);
for i=1:row
for j=1:column-1
if (abs(imagegray(i,j+1) - imagegray(i,j)) > 100)
imagenew(i,j)= 0;
else
imagenew(i,j) = 255;
end
end
end
imshow(imagergb)
pause(5)
imshow(imagenew)
```