def pad(tile, padding):
    """
    Shrink a tile in place, leaving a padding. This returns a copy.

    Parameters
    ----------
    tile : tuple
        containing y and x slice objects
    padding : tuple
        number of pixels to leave along each side, given as ``(y, x)``

    Returns
    -------
    tile : tuple
        a copy; the input is unchaged
    """
    dy, dx = padding
    y, x = tile
    new_tile = slice(y.start + dy, y.stop - dy), slice(x.start + dx, x.stop -
        dx)
    return new_tile
