def bytescl(img, bottom, top):
    """
    Scale a pixel image to limits (0, 1).
    Keyword arguments:
    img    -- Original pixel image.
    bottom -- Lower limit of img.
    top    -- Upper limit of img.
    Output(s):
    scl_img -- Scaled image with new limits 0(min) - 1(max).
    """

    scl_img = (((top - bottom) * (img - img.min())) / (img.max() - img.min())) + bottom
    
    return scl_img