def pad_width_for_tiling(image_shape, tile_shape):
    """
    >>> pad_width_for_tiling((1, 3, 3, 4), (1, 3, 2, 2))
    ((0, 0), (0, 0), (1, 1), (1, 1))
    >>> pad_width_for_tiling((1, 3, 3, 4), (1, 3, 4, 4))
    ((0, 0), (0, 0), (2, 3), (2, 2))
    >>> pad_width_for_tiling((1, 3, 3, 5), (1, 3, 4, 4))
    ((0, 0), (0, 0), (2, 3), (2, 3))
    >>> pad_width_for_tiling((1, 3, 5, 5), (1, 3, 4, 4))
    ((0, 0), (0, 0), (2, 3), (2, 3))
    """
    # if image_shape[2] <= tile_shape[2]:
    #     rows_pad = (0, (tile_shape[2] - image_shape[2]))
    # else:
    #     rows_pad = (tile_shape[2] // 2, tile_shape[2] // 2 + (tile_shape[2] // 2 - image_shape[2]) % (tile_shape[2] // 2))
    #
    # if image_shape[3] <= tile_shape[3]:
    #     cols_pad = (0, (tile_shape[3] - image_shape[3]))
    # else:
    #     cols_pad = (tile_shape[3] // 2, tile_shape[3] // 2 + (tile_shape[3] // 2 - image_shape[3]) % (tile_shape[3] // 2))
    rows_pad = (tile_shape[2] // 2, tile_shape[2] // 2 + (tile_shape[2] // 2 - image_shape[2]) % (tile_shape[2] // 2))
    cols_pad = (tile_shape[3] // 2, tile_shape[3] // 2 + (tile_shape[3] // 2 - image_shape[3]) % (tile_shape[3] // 2))

    return (
        (0, 0),
        (0, 0),
        rows_pad,
        cols_pad
    )