Image segmentation into uniform regions through color coding