# Draw border around constant regions of image

I would like to ask that is it possible to draw borderline - contour - around those cells (pixels) which are neighboring and contains the same value.

An example by hand:

Thanks!

## 1 Answer

One way is to treat it as an image and to use edgedetect:

img = Import["http://i.stack.imgur.com/DI4S4.png"];
ImageMultiply[ColorNegate[EdgeDetect[img, 1, 0.1]], img]