def calc_st_pos_for_centering(bg_size, fg_size):
    '\n    Calculate start postion for centering.\n\n    Parameters\n    ----------\n    bg_size : touple(int)\n        (width, height) of the background image.\n\n    fg_size : touple(int)\n        (width, height) of the foreground image.\n\n    Returns\n    -------\n    touple (int)\n        (st_pos_h, st_pos_v)\n\n    Examples\n    --------\n    >>> calc_st_pos_for_centering(bg_size=(1920, 1080), fg_size=(640, 480))\n    >>> (640, 300)\n    '
    bg_width = bg_size[0]
    bg_height = bg_size[1]
    fg_width = fg_size[0]
    fg_height = fg_size[1]
    st_pos_h = ((bg_width // 2) - (fg_width // 2))
    st_pos_v = ((bg_height // 2) - (fg_height // 2))
    return (st_pos_h, st_pos_v)
Calculate start postion for centering.

Parameters
----------
bg_size : touple(int)
    (width, height) of the background image.

fg_size : touple(int)
    (width, height) of the foreground image.

Returns
-------
touple (int)
    (st_pos_h, st_pos_v)

Examples
--------
>>> calc_st_pos_for_centering(bg_size=(1920, 1080), fg_size=(640, 480))
>>> (640, 300)
def calc_st_pos_for_centering(bg_size, fg_size):
    '\n    Calculate start postion for centering.\n\n    Parameters\n    ----------\n    bg_size : touple(int)\n        (width, height) of the background image.\n\n    fg_size : touple(int)\n        (width, height) of the foreground image.\n\n    Returns\n    -------\n    touple (int)\n        (st_pos_h, st_pos_v)\n\n    Examples\n    --------\n    >>> calc_st_pos_for_centering(bg_size=(1920, 1080), fg_size=(640, 480))\n    >>> (640, 300)\n    '
    bg_width = bg_size[0]
    bg_height = bg_size[1]
    fg_width = fg_size[0]
    fg_height = fg_size[1]
    st_pos_h = ((bg_width // 2) - (fg_width // 2))
    st_pos_v = ((bg_height // 2) - (fg_height // 2))
    return (st_pos_h, st_pos_v)