def calculate_padding(base_image_height, base_image_width, target_image_height, target_image_width):
    """ 
    Calculate the padding Values for the given images so that they are of same size

    Parameters
    ----------
    base_image_height : int
        The height of the baseline image
    base_image_width : int
        The width of the baseline image
    target_image_height : int
        The height of the target image
    target_image_width : int
        The height of the target image

    Returns
    -------
    base_left : int
        Left padding value for Baseline Image
    base_right : int
        Right padding value for Baseline Image
    base_top : int
        Top padding value for Baseline Image
    base_bottom : int
        Bottom padding value for Baseline Image
    target_left : int
        Left padding value for Target Image
    target_right : int
        Right padding value for Target Image
    target_top : int
        Top padding value for Target Image
    target_bottom : int
        Bottom padding value for Target Image
    """
    delta_height = max(base_image_height, target_image_height) - \
        min(base_image_height, target_image_height)
    delta_width = max(base_image_width, target_image_width) - \
        min(base_image_width, target_image_width)

    target_top = target_left = target_bottom = target_right = base_top = base_left = base_bottom = base_right = 0

    # both images are of same size
    if(delta_height == 0 and delta_width == 0):
        return (base_left, base_right, base_top, base_bottom, target_left, target_right, target_top, target_bottom)

    top, carry = divmod(delta_height, 2)
    bottom = top + carry
    left, carry = divmod(delta_width, 2)
    right = left + carry

    # Assign the top, bottom, left, right padding values tom make
    # the image of same size
    if(base_image_height > target_image_height):
        target_top = top
        target_bottom = bottom
    elif(base_image_height < target_image_height):
        base_top = top
        base_bottom = bottom

    if(base_image_width > target_image_width):
        target_left = left
        target_right = right
    elif(base_image_width < target_image_width):
        base_left = left
        base_right = right

    return (base_left, base_right, base_top, base_bottom, target_left, target_right, target_top, target_bottom)