def image_shape(img):
    """return image shape
    Args:
        img (HxWx(c) array): image
    Returns:
        h,w,c (int): if image has 3 channels
        h,w,1 (int): if image has 2 channels
    """
    if len(img.shape) == 3:
        return img.shape
    elif len(img.shape) == 2:
        h, w = img.shape
        return h, w, 1