def _get_tile_translation(tile_grid_dict, img_size, img_overlap):
    """Calculates translation for each tile depending on their position
    in a grid, their size and overlap.
    Translations are returned as values in a dictionary with tile positions as keys.

    Args:
        tile_grid_dict (dict): Tile numbers and their respective positions in the grid.
        img_size (tuple): Size of images (pixel in y- and x-direction).
        img_overlap (float): Overlap between tiles in percentage.

    Returns:
        (dict): Tiles and their translation (x and y direction).
    """
    assert len(img_size) == 2, f"img_size should be a tuple with two integers for y- and x-dimensions of a tile image."
    assert (img_overlap < 1) and (img_overlap > 0), ("img_overlap should be a float thats represents tile overlap"
                                                      f"in percentage, instead got: {img_overlap}")
    y_size, x_size = img_size

    tile_trans = {}
    # iterate over tiles and find translations in x and y direction
    for tile, (row, col) in tile_grid_dict.items():
        x_trans = ((col - 1) * x_size) - ((col - 1) * (x_size * img_overlap))
        y_trans = ((row - 1) * y_size) - ((row - 1) * (y_size * img_overlap))
        tile_trans[tile] = (x_trans, y_trans)

    return tile_trans