def merge_with_alpha(bg_img, fg_img, tf_str=tf.SRGB, pos=(0, 0)):
    '\n    合成する。\n\n    Parameters\n    ----------\n    bg_img : array_like(float, 3-channel)\n        image data.\n    fg_img : array_like(float, 4-channel)\n        image data\n    tf : strings\n        transfer function\n    pos : list(int)\n        (pos_h, pos_v)\n    '
    f_width = fg_img.shape[1]
    f_height = fg_img.shape[0]
    bg_merge_area = bg_img[pos[1]:(f_height + pos[1]), pos[0]:(f_width + pos[0])]
    bg_linear = tf.eotf_to_luminance(bg_merge_area, tf_str)
    fg_linear = tf.eotf_to_luminance(fg_img, tf_str)
    alpha = (fg_linear[:, :, 3:] / tf.PEAK_LUMINANCE[tf_str])
    out_linear = (((1 - alpha) * bg_linear) + fg_linear[:, :, :(- 1)])
    out_merge_area = tf.oetf_from_luminance(out_linear, tf_str)
    bg_img[pos[1]:(f_height + pos[1]), pos[0]:(f_width + pos[0])] = out_merge_area
    return bg_img
合成する。

Parameters
----------
bg_img : array_like(float, 3-channel)
    image data.
fg_img : array_like(float, 4-channel)
    image data
tf : strings
    transfer function
pos : list(int)
    (pos_h, pos_v)
def merge_with_alpha(bg_img, fg_img, tf_str=tf.SRGB, pos=(0, 0)):
    '\n    合成する。\n\n    Parameters\n    ----------\n    bg_img : array_like(float, 3-channel)\n        image data.\n    fg_img : array_like(float, 4-channel)\n        image data\n    tf : strings\n        transfer function\n    pos : list(int)\n        (pos_h, pos_v)\n    '
    f_width = fg_img.shape[1]
    f_height = fg_img.shape[0]
    bg_merge_area = bg_img[pos[1]:(f_height + pos[1]), pos[0]:(f_width + pos[0])]
    bg_linear = tf.eotf_to_luminance(bg_merge_area, tf_str)
    fg_linear = tf.eotf_to_luminance(fg_img, tf_str)
    alpha = (fg_linear[:, :, 3:] / tf.PEAK_LUMINANCE[tf_str])
    out_linear = (((1 - alpha) * bg_linear) + fg_linear[:, :, :(- 1)])
    out_merge_area = tf.oetf_from_luminance(out_linear, tf_str)
    bg_img[pos[1]:(f_height + pos[1]), pos[0]:(f_width + pos[0])] = out_merge_area
    return bg_img