def check(image):
    """Returns whether an image is in gray scale"""
    img = image.convert('RGB')

    w, h = img.size

    for i in range(w):
        for j in range(h):
            r, g, b = img.getpixel((i, j))
            if r != g != b:
                return False
    return True