def img2gray(img, mode='L'):
    """
    Converts an image (:epkg:`PIL`) to gray scale.

    @param      img     see *Image* from :epkg:`PIL`
    @param      mode    ``'L'`` or ``'LA'``
    @return             see *Image* from :epkg:`PIL`
    """
    return img.convert(mode)