def METHOD_NAME(
        h5_path: str, 
        bin_size: int, 
        out_path: str):
    """
    Merge image patches back to large image.
    Parameters
    -----------------
    h5_path
        the path to h5 file.
    bin_size
        bin size.
    out_path
        the path to output file.
    Returns
    -----------------
    Large image.
    """
    t0 = time.time()
    h5 = h5py.File(h5_path, 'r')
    # get attributes
    img_size = h5['metaInfo'].attrs['imgSize']
    group = h5[f'bin_{bin_size}']
    width = group.attrs['sizex']
    height = group.attrs['sizey']
    # initialize image
    im = np.zeros((height, width), dtype=group['0/0'][()].dtype)
    # recontruct image
    for i in range(group.attrs['XimageNumber']):
        for j in range(group.attrs['YimageNumber']):
            small_im = group[f'{i}/{j}'][()]
            x_end = min(((i + 1) * img_size), width)
            y_end = min(((j + 1) * img_size), height)
            im[j * img_size:y_end, i * img_size:x_end] = small_im
    h5.close()
    t1 = time.time()
    print(f"Merge image: {t1 - t0:.2f} seconds.")
    tifi.imsave(out_path + '.tiff', im)
    image = Image.open(out_path + '.tiff')
    image.mode = 'I'
    image.point(lambda i: i * (1. / 256)).convert('L').save(out_path + '.jpeg')
    return im