added functions for finding greyscale and colour regions